UIAlertView在iOS 8.3中崩溃 [英] UIAlertView crashs in iOS 8.3

查看:207
本文介绍了UIAlertView在iOS 8.3中崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我开始只接受使用iOS 8.3的用户接收UIAlertView的崩溃报告

recently i start receiving crash reports for UIAlertView only by users that use iOS 8.3

Crashlytics报告:

Crashlytics reports:


致命异常:UIApplicationInvalidInterfaceOrientation
支持的方向与应用程序没有共同的方向,[_UIAlertShimPresentingViewController shouldAutorotate]返回YES

Fatal Exception: UIApplicationInvalidInterfaceOrientation Supported orientations has no common orientation with the application, and [_UIAlertShimPresentingViewController shouldAutorotate] is returning YES

发生崩溃的行是[alertView show]:

The line where that crash happens is [alertView show] :

UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
                                                    message:message
                                                   delegate:nil
                                          cancelButtonTitle:cancelButtonTitle
                                          otherButtonTitles:nil];
[alertView show];

该代码在应用程序中存在很长时间,现在它开始崩溃。有没有人遇到类似的行为并修复了问题?

that code is in the app for a long time and now it starts crashing. Did anyone experience a similar behaviour and has fixed the problem?

推荐答案

试着实现这个

- (BOOL)shouldAutorotate {
   return NO;
}

-(NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
}

同时检查: Lanscape模式下的定位问题,同时在iPhone 7中打开iOS 7中的相机

这篇关于UIAlertView在iOS 8.3中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆