Bladeren bron

Guard against returning 0 from supportedInterfaceOrientations.

Returning 0 from this method causes an exception to be thrown.
Ryan Olson 12 jaren geleden
bovenliggende
commit
43d35f5beb
1 gewijzigde bestanden met toevoegingen van 7 en 0 verwijderingen
  1. 7 0
      Classes/Explorer Toolbar/FLEXExplorerViewController.m

+ 7 - 0
Classes/Explorer Toolbar/FLEXExplorerViewController.m

@@ -172,6 +172,13 @@ typedef NS_ENUM(NSUInteger, FLEXExplorerMode) {
     if (viewControllerToAsk != self) {
         supportedOrientations = [viewControllerToAsk supportedInterfaceOrientations];
     }
+    
+    // The UIViewController docs state that this method must not return zero.
+    // If we weren't able to get a valid value for the supported interface orientations, default to all supported.
+    if (supportedOrientations == 0) {
+        supportedOrientations = UIInterfaceOrientationMaskAll;
+    }
+    
     return supportedOrientations;
 }