UIAlertviewController在IOS8.3中崩溃

时间:2015-04-18 10:27:43

标签: ios objective-c uialertcontroller 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'

不知道该怎么做请帮助我。

1 个答案:

答案 0 :(得分:3)

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

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL) shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}