I have a question about iOS 6 Orientation.Here is my file https://www.dropbox.com/s/f8q9tghdutge2nu/Orientations_iOS6.zip
In this sample code,I want to make the MasterViewController only has a Portrait Orientation and the DetailViewController has a Portrait Orientation,Landscape Orientation.
I know iOS 6 Orientation is controlled by top-most controller.
So I custom a UINavigationController(CustomNavigationController), set supportedInterfaceOrientations and shouldAutorotate in that class.
-(NSUInteger)supportedInterfaceOrientations{
if([[self topViewController] isKindOfClass:[DetailViewController class]]){
return UIInterfaceOrientationMaskAllButUpsideDown;
}else{
return UIInterfaceOrientationMaskPortrait;
}
}
-(BOOL)shouldAutorotate
{
return YES;
}
Everything is fine except when DetailViewController at Landscape Orientation press back button,MasterViewController will show the Landscape Orientation.
Can I let MasterViewController always show Portrait Orientation and DetailViewController can has many orientation?
thanks!