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
You need to create category of UITabBarController to support should auto rotate
code of .h file is as
@interface UITabBarController (autoRotate)
-(BOOL)shouldAutorotate;
- (NSUInteger)supportedInterfaceOrientations;
@end
code of .m file is as
-(BOOL)shouldAutorotate {
AppDelegate *delegate= (AppDelegate*)[[UIApplication sharedApplication]delegate];
return [delegate.tabBarController.selectedViewController shouldAutorotate];
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskAll;
}
Note: Name of AppDelegate will be changed with your project's AppDelegate File name.