The official doc says that UISupportedInterfaceOrientations is an array of strings. https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW10
So the solution is to use NSString comparison for each element found in the array.
NSArray *supportedOrientations = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UISupportedInterfaceOrientations"];
for (NSString *orientation in supportedOrientations) {
if ([orientation isEqualToString:@"UIInterfaceOrientationPortrait"] ||
[orientation isEqualToString:@"UIInterfaceOrientationPortraitUpsideDown"]) {
NSLog(@"*** We detect Portrait mode!");
} else if ([orientation isEqualToString:@"UIInterfaceOrientationLandscapeLeft"] ||
[orientation isEqualToString:@"UIInterfaceOrientationLandscapeRight"]) {
NSLog(@"*** We detect Landscape mode!");
}
}
Note that doing like this we didn't take advantage of the enum values (of type UIInterfaceOrientation), but it works!