ios - UIAlertviewController 在 IOS8.3 中崩溃

标签 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'

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

最佳答案

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

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskAll;
}

- (BOOL) shouldAutorotate {
    return YES;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
    return UIInterfaceOrientationPortrait;
}

关于ios - UIAlertviewController 在 IOS8.3 中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29716011/

相关文章:

ios - CFBundleURLName 必须匹配 CFBundleIdentifier 吗?

iphone - NSData getBytes 在模拟器中提供与在设备上不同的结果

ios - NSNotification:尝试在其 View 不在窗口层次结构中的 ViewController 上显示 UIAlertController

Swift:在闭包中呈现 UIAlertController

ios8 - 如何在键盘处于事件状态时呈现 UIAlertController 操作表?

ios - MVC : should i add and implement touch gestures in the View Controller or my custom subclass of UIView

ios - 无法在 IOS 中从 Facebook 获取笔记内容

ios - 在 viewDidLoad 中的 tabBarController 上设置 SelectedIndex 不起作用

ios - UITextField 不会将文本保存到 CoreData 中

ios - 可以在按下标签栏按钮时进行模态转换吗?