I am developing a iPad application which always shows in Landscape mode. in iOS5, I was using 'shouldAutorotateToInterfaceOrientation' to return the value as 'YES' and I also configured the info.plist to support only the landscape mode. All goes well.
In iOS 6, I am aware that the method 'shouldAutorotateToInterfaceOrientation' is deprecated. I went thru lot of discussions in the net and tried all suggested solutions but the results are still zero (Meaning, iOS6 simulator shows in portrait mode.
My code is given below…. Any advise is very much appreciated…
In the AppDelicate.m
MyTestUI *myTest = [[MyTestUI alloc] init];
navigationController = [[UINavigationController alloc] initWithRootViewController:myTest];
[navigationController setNavigationBarHidden:YES];
[self.window addSubview:navigationController.view];
[self.window makeKeyAndVisible];
[myTest release];
return YES;
in the MyTestUI.m
- (BOOL)shouldAutorotate {
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait) {
}
return YES;
}
**// iOS 5.1 Fix is below**
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
