, , , , , iOS 5.x( ), , :
[1] iOS , .
a) - - . ( , , ). ( "iPhone " - )
b) - "ViewDidLoad" "applicationDidBecomeActive" ( , - - ..)
c) didChangeStatusBarOrientation. Window.frame.size, .
, , .
: - , "didChangeStatusBarOrientation" .
[2] Non-Code Solution: ( : )
a) , , /info.plist. 1 " ", "", . ( , , " ", , , .)
[3] :
a) iOS , iOS6 , - .
, , ( ipad , ... iOS 5.1.1 - )
-(void) OrientationAndScreenSizeHELPER : (NSString *)fromObject
{
CGRect appFrame = [[UIScreen mainScreen ]applicationFrame];
appFrame = [[self.viewController view]frame];
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
NSLog(@"orientation[%ld] at time[%@] width[%ld] height[%ld]",
(long)orientation,
fromObject,
(long int)appFrame.size.width,
(long int)appFrame.size.height);
}
**Output:**
orientation[1] at time[ViewDidLoad Orientation] width[768] height[1024]
orientation[1] at time[applicationDidBecomeActive] width[768] height[1024]
orientation[3] at time[didChangeStatusBarOrientation] width[1024] height[768]