I have some views in my app that I don\'t want to suport orientation.
In didFinishLaunchingWithOptions
I add navigation:
...
UINavigationControl
It's because neither UITabBarcontroller
nor UINavigationController
is passing shouldAutorotate to its visible view controller. To fix that you may subclass either UITabBarController or UINavigationController and forward shouldAutorotate from there:
In your subclassed UITabBarController add:
- (BOOL)shouldAutorotate
{
return [self.selectedViewController shouldAutorotate];
}
In your subclassed UINavigationController add:
- (BOOL)shouldAutorotate
{
return [self.visibleViewController shouldAutorotate];
}
in the AppDelegate
:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window // iOS 6
{
return UIInterfaceOrientationMaskAll;
}
in your ViewController:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}