Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4.5 device orientation change?

I am in the process of building a cocos2d game with kobold2d and since I upgraded to xcode 4.5 every time I build the project the device orientation starts out in landscape and the rotates to portrait mode automatically? I in the precious versions of xcode the default orientation is landscape but now it keeps switching on its own.

like image 228
Stephen Avatar asked Mar 07 '26 18:03

Stephen


1 Answers

In AppDelegate change the line that says something like:

[window addSubView:viewcontroller.view];

to

[window setRootViewController:viewcontroller];

that should do it.

like image 117
marciokoko Avatar answered Mar 10 '26 15:03

marciokoko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!