IOS 8.3 supported orientations

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

Application termination due to the uncaught exception "UIApplicationInvalidInterfaceOrientation", reason: "Supported orientations do not have a common orientation with the application, but [... shouldAutorotate] returns YES

When "..." is a lot of classes. The specific problem is the UIAlertView class, I have the same UIAlertView crashes problem in iOS 8.3 but I cannot resolve the UIAlertView subclass (Apple says that the UIAlertView class is intended to be used as it is and does not support subclasses) or using the UIAlertController. Can you help me?

+7
objective-c uiinterfaceorientation
source share
4 answers

Many other applications do not crash with this error, so I was wondering if there is anything else in our application that counts in this failure. I made sure that iOS 8 gets the UIAlertController so that it doesn't crash, but that doesn't help third-party frameworks.

Another engineer from our team eventually fixed this:

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

I don’t know what changed from iOS 8.2 to 8.3 and why they changed it because it worked fine. This is annoying.

In any case, I solved this problem using link to link.

https://gist.github.com/mkeremkeskin/0ed9fc4a2c0e4942e451

+2
source share

Having tried the solutions here, none of them worked for me. I support iOS 6-8 in the application and, moreover, I use some libraries that use UIAlertView internally, so just conditional compiling to use UIAlertController when it is not available is not an option.

I came up with a solution that solved the problem for me. Your mileage may vary. I include the header file in the header header file so that it is included wherever the UIAlertView is displayed.

I post this here for those who stumble upon this problem, and the solutions found on the network do not work. Hope this helps.

https://gist.github.com/joshhudnall/cdc89b61d0a545c85d1d

+1
source share

I solved this problem as follows:

 if objc_getClass("UIAlertController") != nil { println("UIAlertController can be instantiated") //make and use a UIAlertController iOS8 } else { println("UIAlertController can NOT be instantiated") //make and use a UIAlertView iOS7 } 

Then you can save your application in iOS 7 and iOS 8

0
source share

All Articles