How to retrieve the location of a control on the view?
- by amok
I have a button on a view, I want to add another button next to it when the first button is touched.
Therefore I need it's top left corner to do the math.
Here's what is puzzling me greatly:
// this code is executed when the button is pressed
NSLog(@"X:%f",moreButton.frame.origin.x);
that returns on the first and second click the followings:
2010-04-24 22:58:25.883 iPad PopOver[8095:40b] X:-1.999002
2010-04-24 22:58:25.884 iPad PopOver[8095:40b] Y:0.000000
why and how can I get the x,y of an existing button on the view? (button created via IB)
Thanks!
mE
ps: I have looked at similar posts and my code looks fine but I keep getting zeros (it's an ipad app if matters in any way)