Since iOS updated some orientation relative methods are not working and app orientation support is broken. The following two scenarios are the most of the user have issues in iOS 6 fixing these is really easy with the simple code changes as shown below.
- Deprecated:
This method is deprecated in iOS 6, instead of this we need to use these two methods:
-(NSUInteger) supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } -(BOOL)shouldAutorotate { return YES; }- Deprecated:
This method is deprecated so we need to use it as following.
if ( [[UIDevice currentDevice].systemVersion floatValue] < 6.0)
{
// warning: addSubView doesn’t work on iOS6
[self.window addSubview: mainController.view];
}
else
{
// use this method on ios6
[self.window setRootViewController:mainController];
}
Leave your comments and questions below.