UIAlertviewController 在 IOS8.3 中崩溃

UIAlertviewController crashes in IOS8.3

我正在使用 UIAlertView 但在 IOS 8.3 中我更改为 UIAlertViewController 因为 UIAlertview 不工作但是 UIAlertViewController 崩溃并出现错误

'UIApplicationInvalidInterfaceOrientation',
reason: 'Supported orientations has no common orientation with 
         the application, and 
         [ChartsTableViewController2_iPhone shouldAutorotate] is returning YES'

不知道该怎么办,请帮帮我。

尝试继承 UIAlertController 并添加此代码。希望对你有帮助。

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL) shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}