私は、ポートレートである 1 つの方向のみを使用しているアプリに取り組んでいます。これはデバイスの向きの設定です:
しかし、私のアプリにはMPMoviePlayerViewController、Landscape Right モードでのみ表示したいビデオ プレーヤー (のカスタム プレーヤー) があり、回転させるべきではありません。これは正常に動作しています。つまり、このカスタム プレーヤーは完全に横向きで表示されUIAlertviewますが、アプリケーションを使用しているときに、このメソッドでクラッシュします。
- (BOOL)shouldAutorotate {
return NO;
}
これらは、いくつかの他の向きの方法です:
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeRight; // or Right of course
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
return UIInterfaceOrientationMaskLandscape;
}
このエラーが発生しています:
*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES'

