Search code examples
iosios7appstore-approvaluiinterfaceorientation

Using UIDevice - setOrientation will make app rejected?


To force portrait, I need to use the following snippet and I wish to learn if by using it, will make the app get rejected from appstore approval?

[[UIDevice currentDevice] performSelector:NSSelectorFromString(@"setOrientation:")

Solution

  • Why don't you just use this method? In your AppDelegate.m:

    - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
    {
    
            return UIInterfaceOrientationMaskPortrait;
    }
    

    It forces the portrait orientation and much safer then anything else. I used it in one of my apps and it was approved by Apple.