2

Already added below code in AppDelegate.m but still not working in portrait.

-(NSUInteger)supportedInterfaceOrientations {
  return UIInterfaceOrientationMaskPortrait;

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}

Here is Xcode summary page: enter image description here

Guru
  • 21,652
  • 10
  • 63
  • 102

1 Answers1

7

Got solution. We can set orientation in setupCocos2dWithOptions.

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self setupCocos2dWithOptions:@{
        CCSetupShowDebugStats: @(YES),
        CCSetupScreenOrientation: CCScreenOrientationPortrait,
    }];

    return YES;
}
Guru
  • 21,652
  • 10
  • 63
  • 102