I want several of my app viewcontrollers to not rotate in iOS 6.0. This is what i did to make the rotation in iOS 6 possible:
1.) Set the windows rootviewController
If you want all of our navigation controllers to respect the top view controller you can use a category. I've found it easier than subclassing.
@implementation UINavigationController (Rotation_IOS6)
-(BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
@end