2013年7月23日 星期二

【Cocos2D】錯誤修改 -'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'

撰寫軟體:cocos2D
軟體版號:cocos2d-iphone-1.1-RC0
程式版型:cocos2d_chipmunk

錯誤顯示:

'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'

修改方法:


// these methods are needed for iOS 6
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 60000

-(NSUInteger)supportedInterfaceOrientations{
    //Modify for supported orientations, put your masks here, trying to mimic behavior of shouldAutorotate..
    /*
    #if GAME_AUTOROTATION==kGameAutorotationNone
    return UIInterfaceOrientationMaskPortrait;
    #elif GAME_AUTOROTATION==kGameAutorotationCCDirector
    NSAssert(NO, @"RootviewController: kGameAutorotation isn't supported on iOS6");
    return UIInterfaceOrientationMaskLandscape;
    #elif GAME_AUTOROTATION == kGameAutorotationUIViewController
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
    //for both landscape orientations return UIInterfaceOrientationLandscape
    #else 
    #error Unknown value in GAME_AUTOROTATION
#endif // GAME_AUTOROTATION
     */
    return UIInterfaceOrientationMaskAll;

}