I'd like to have the coordinates relative to the main window, therefore I'm using convertRect:toView: with nil as second parameter:
CGRect result = [self.view convertRect:addToList.frame toView:nil];
But as a result, I always get
NSRect: {{5, 30}, {35, 35}}
and that are exactly the values I use for generating the addToList-view:
addToList = [UIButton buttonWithType:UIButtonTypeCustom];
addToList.frame = CGRectMake(5.0f, 30.0f, 35.0f, 35.0f);
If I'm adding the addToList-button to a view which is placed in the bottom right corner of the screen, I would expect a CGRect like for example 950, 700, 35, 35 on an iPad landscape, because those are the coordinates of the button relative to the topmost view.
First, I did the conversion in the initWithFrame:-method of a UIViewController; but now, I'm doing it afterwards... what am I missing?
Thanks!
EDIT: is it important that "self.view" is inside a UIScrollView?