Search code examples
iosobjective-ccocos2d-iphone

Orientation not changing to portrait, iOS game


Am new to Xcode, using version 8, and have a small game done.

The problem I am facing is that the orientation is in landscape, which I can't get to portrait, in the simulator and on device.

Tried the following :

  1. Changing Device Orientation under Deployment Info to Portrait,

  2. Adding 'Portrait' under Supported interface orientations in the Info.plist file.

Maybe I m missing out on something that I may have overlooked. Could somebody shed some light on this?


Solution

  • Well, just found this out. I am using cocos2D framework, which has the 'startUpOptions' Dictionary object (in AppDelegate.m) that need to be specified if the game needs to be in 'Portrait' mode thus:

    [startUpOptions setObject:CCScreenOrientationPortrait forKey:CCSetupScreenOrientation];