Xcode版本:7.1,运行环境:iPhone 6s Plus
我的AppDelegate.mm文件包含如下代码:
- (void) applicationDidFinishLaunching:(UIApplication*)application
---------some code
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
NSLog(@"if");
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
#else
NSLog(@"else");
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
#endif
---------somecode
我的GameConfig.h文件中包含:
#define GAME_AUTOROTATION kGameAutorotationUIViewController
我的RootViewController.m文件中有:
if GAME_AUTOROTATION == kGameAutorotationUIViewController
return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
我的Xcode设置如下:
![enter image description here](https://istack.dev59.com/RZT46.webp)
![enter image description here](https://istack.dev59.com/X3DyT.webp)