iOS 8.3支持的方向崩溃 [英] iOS 8.3 supported orientations crashs

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

问题描述

我的应用程序和iOS 8.3遇到了很大的问题. 我发生了多次崩溃,并始终出现相同的错误:

I have a big problem with my app and iOS 8.3. I have many crashes with always the same error:

由于未捕获的异常而终止应用程序 'UIApplicationInvalidInterfaceOrientation',原因:'受支持 方向与应用程序没有共同的方向,并且[... shouldAutorotate]返回YES

Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [... shouldAutorotate] is returning YES

当"..."有多个类时. 一个特别的问题是类UIAlertView,我也遇到以下同样的问题: iOS 8.3中的UIAlertView崩溃 但我无法解析UIAlertView的子类(Apple表示UIAlertView类旨在按原样使用,不支持子类)或使用UIAlertController. 你能帮助我吗?

When "..." are many classes. A particular problem is the class UIAlertView, I have the same problem of UIAlertView crashs in iOS 8.3 but I can't resolve subclassing UIAlertView (Apple says that the UIAlertView class is intended to be used as-is and does not support subclassing) or using UIAlertController. Can you help me?

推荐答案

很多其他应用程序都没有因此错误而崩溃,所以我想知道我们的应用程序中是否还有其他原因导致了此崩溃.我确保iOS 8将获得UIAlertController,这样它就不会崩溃,但这对第三方框架没有帮助.

A lot of other apps didn't crash with this bug, so I was wondering if there was something else in our app that accounted to this crash. I made sure iOS 8 would get the UIAlertController so it wouldn't crash but that doesn't help with third-party frameworks.

我们团队中的另一位工程师最终通过以下方式对其进行了修复:

Another engineer in our team eventually fixed it by doing this:

- (NSUInteger)supportedInterfaceOrientations {
    return UIInterfaceOrientationMaskPortrait;
    // This used to be:
    //return UIInterfaceOrientationPortrait;
}

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

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