I have just run template from Xcode (Master-Detail Application for iPhone). I only added
NSLog(@"%@", NSStringFromCGRect(self.view.bounds));
in DetailViewController:viewdidLoad
and when I rotated the screen (on Simulator) on MasterViewController to Landscape next I pushed a DetailViewController, in console I’ve seen:
{{0, 0}, {320, 460}}
which is not correct because, view is in Landscape.
Any idea why?
Your view’s bounds is portrait by default.
If you launch your application in landscape mode, a rotation message is sent to view controller before it appears. so try to print in
viewDidAppear.