Unable to force landscape with iOS5/4 target while using setDesignResolutionSize


I’m stuck with this very stubborn issue.

It’s not a problem to force landscape in cocos2dx. There are numerous posts about this.

However, the following combination does not allow landscape to be forced (it will look messed up on the device)
* you set the target at 5.0
* while using setDesignResolutionSize,
* and deploying to an iPhone 4 device (not simulator!)

Note: Works fine on iPad 1 (iOS 5) and the the simulators.

It works fine in the simulator, or with the iOS 6 target. Also when removing the line with setDesignResolution form my code, landscape will work.

I attached the HelloWorld project, with a modified AppDelegate. I added setDesignResolution, lowered the target to 5.0 and removed ARMv7s arch to fix a build error. Also I had to comment out a line with wordBreakLeft from cocos2dx that caused a build error.

Does anyone have a solution for this? Appearenly only iOS6 is supported?

This HelloWorld project demonstrates the issue: http://infinus.nl/css/landscape-bug-demo.zip
Tested and reproduced with cocos2dx 2.1.5 and 2.1rc0-x-2.1.4.


I’m not sure how to get the attachment — have you tried 2.1.2? Out of curiosity, that is the version I’m building with right now and I think it is working.

Are you using CocosBuilder as well?


Download the bug reproducing project here: http://infinus.nl/css/landscape-bug-demo.zip
I basically tried every combination of cocos2dx versions, targets, sdks and viewcontroller hacks.
Will try with 2.1.2. I dont expect any difference since i’ve tried a couple of other versions.
I’m not using cocos2builder (yet).


I finally fixed it.

Appearently, I had an old iPhone5.1 SDK copied inside my xcode.
Even while selecting Base SDK 6.1, XCode used my old 5.1. This forced me to remove the armv7s arch. Appearently this caused the bug.

So glad it works now!