xcode: get y-position of uibutton - objective-c

I know that's quite an easy one but I haven't found anything about it.
All I want is how I can get the y-position of a unbutton?
I hope that anyone can help.
Thanks in advance.

Since UIButton is a subclass of UIView you can simply use
button.frame.origin.y

Or you can use a more flexible way
CGRectGetMinY(button.frame)
for example you can get the mid Y pos like this
CGRectGetMidY(button.frame)

Related

tableView.setScrollEnabled is No, DidSelectRowAtIndex not responding

If tableView.scrollEnabled = NO, then didSelectRowAtIndexPath is not responding to first touch, but only to the second select row. Do you have any idea why??
Please help.
make sure you have not implemented
didDeselectRowAtIndexPath
rather than implementing
didSelectRowAtIndexPath

Does heightForRowAtIndexPath get called before cellForRowAtIndexPath?

I have certain code that I am refactoring and this came up
Thanks
Quite easy to tell by yourself, just add one NSLog in each of these methods... But yes, it's called before.

Display NSArray on window IB

I have an application that reads/parses data into a file and store it into a NSMutableArray.
I need to display the contents (data) of this array into a window (tableview or else don't care) the only problem is that the data is not static so i can't fix n labels if you understand me.
If someone can help me
Thanks to all
This is for solve such problems that Apple design the UITableViewDelegate protocol
Follow the documentation and you should solve your problem.
This is a job for Cocoa Bindings.

NSLog Can see what Expression Watcher Cannot in Xcode

I wonder why?
By the way anyone can see the screen shot?
Try to expand self and then on currentproperty

Displaying a list of views

Here's a mockup:
A mockup http://img.skitch.com/20090228-mqdj17xijycc98spf181a8q6q7.jpg
I have been trying to find some sample code that showcases something like this -- a scroll view with a list of custom views. Haven't found anything. I've been trying to find some open source projects that does this (that isn't Adium with a million files and lines of code), but haven't found anything there either.
I've been told that I can use NSMatrix to achieve this. Again, haven't found any sample code.
Anyone got some suggestions? Or sample code ; )
You could also use NSTableView and create a custom subclass of NSCell to render the content.
If you can require Leopard, take a look at NSCollectionView. The API is a little weird but it's pretty powerful once you get the hang of it.
I've been told that I can use NSMatrix to achieve this.
You can't. NSMatrix uses cells, not views.
To answer your question: What James Williams said.