When I use this code:
- (void)viewDidLoad
{
[super viewDidLoad];
CGFloat mainViewWidth = self.view.bounds.size.width;
NSLog(@"%f", mainViewWidth);
}
I got the result in simulator:480
and when i start the app on my iPhone 4 i got the result 320?
Did I do something wrong?
Do the same in
viewWillAppear.and see if you are getting correct values..
ViewDidLoadgets called before view is drawn completely. AccessingUIViewsize property gives you unpredictable values there.