I have a presented a navigation controller, in which the root view controller i,e. VC1 is supported for both landscape & portrait orientations. When i push another view controller in landscape the i,e. VC2 which supports only portrait mode, come back to the VC1, the view will be turned to portrait. But i am still in the landscape mode. Please help me to solve this on iOS 6 issue.
Please check the below code.
MyViewController1 *theController =[[MyViewController1 alloc] init];
UINavigationController *navCntlr = [[UINavigationController alloc] initWithRootViewController:theController];
[self.navigationController presentViewController:navCntlr animated:YES completion:nil]; [theController release];
[navCntlr release];
in MyViewController1
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
in VC2/MyViewController2 i have added the below code.
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
i have subclassed the root navigation bar as well.