I am working on a app in which I am using only one orientation which is Portrait. This is device orientation setting:
But In my app there is Video player (Custom Player of MPMoviePlayerViewController
) which I wanted to show in Landscape Right mode only and It should not be rotated.
This is working fine, I mean this Custom Player is showing in Landscape Right perfectly, but when I am using an UIAlertview
then application is crashed on this method:
- (BOOL)shouldAutorotate {
return NO;
}
These are some other orientation methods :
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeRight; // or Right of course
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
return UIInterfaceOrientationMaskLandscape;
}
I am getting this Error:
*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES'