I have following Controllers, (I have selected all types orientation modes in iPad)
Here is my iPad Storyboard layout
Custom NavigationController > Loading Ctrl > Main Controller.
My Custom Navigation Contains
-(BOOL)shouldAutorotate
{
return [[self.viewControllers lastObject] shouldAutorotate];
}
-(NSUInteger)supportedInterfaceOrientations
{
return [[self.viewControllers lastObject] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation];
}
In my Loading Controller
-(BOOL)shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM())
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
else
return UIInterfaceOrientationMaskPortrait;
}
The supportedInterfaceOrientations gets called as usual and everything seems ok, But when I push my Main Controller using performSegue
-(NSUInteger)supportedInterfaceOrientations
{
if (UIUserInterfaceIdiomPad == UI_USER_INTERFACE_IDIOM())
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
else
return UIInterfaceOrientationMaskPortrait;
}
No more calls in MainController. Why is that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…