某一個頁面橫屏時會出現崩潰的問題描述,原因是當你在AppDelegate中返回的設備方向是UIInterfaceOrientationMaskLandscapeLeft.但是你在視圖控制器中返回支持自動旋轉。就會拋出此異常。
解決方法 重寫UIAlertContrller 的shouldAutorotate 方法,
#import <UIKit/UIKit.h> @interface UIAlertController (Rotation) - (BOOL)shouldAutorotate; @end #import "UIAlertController+Rotation.h" @implementation UIAlertController (Rotation) - (BOOL)shouldAutorotate { return NO; } @end
即可
by:初光夫
