Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
626 views
Welcome To Ask or Share your Answers For Others

1 Answer

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;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...