In the default cocos2d 1.0 beta template, AppDelegate.m has some code:
// AppDelegate.m
// IMPORTANT:
// By default, this template only supports Landscape orientations.
// Edit the RootViewController.m file to edit the supported orientations.
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
[director setDeviceOrientation: kCCDeviceOrientationPortrait];
#else
[director setDeviceOrientation: kCCDeviceOrientationLandscapeLeft];
#endif
Next, In GameConfig.h, we have defined:
// GameConfig.h
#define kGameAutorotationNone 0
#define kGameAutorotationCCDirector 1
#define kGameAutorotationUIViewController 2
//
// Define here the type of autorotation that you want for your game
#define GAME_AUTOROTATION kGameAutorotationUIViewController
Together, this was working to produce a landscape setup that auto-rotated to either landscape-left or landscape-right depending on how you held the device. TableViews autorotated as well (I have several tables placed on top of some cocos2d CCScenes).
However…I updated to iOS6 last night. As well as XCode 4.5.
I’m hoping it’s not just me, but my app’s rotation is completely broken now. I’m trying to fix it via code for at least one tableview…changing GAME_AUTOROTATION seems to have no affect on tableviews, just the cocos2d CCScenes (which is half of the solution in a way).
I may just start from scratch and get something built up instead of working with pre-written code, this is just mega-frustrating!! Thanks a lot, Apple!
The answer was to upgrade my stuff to cocos2d 2.0 and to remove the dependency on the RootViewController, which is no longer used.