Skip to content

Instantly share code, notes, and snippets.

@bernardinus
Created November 20, 2013 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bernardinus/7557624 to your computer and use it in GitHub Desktop.
Save bernardinus/7557624 to your computer and use it in GitHub Desktop.
cocos2d-iphone v1.0.1 iOS 6 Fix AppDelegate.m replace [window addSubview:viewController.view]; RootViewController.m add new function
//iOS 6 Fix
{
NSString *reqSysVer = @"6.0";
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
if([currSysVer compare:reqSysVer options:NSNumericSearch]!=NSOrderedAscending)
{
[window setRootViewController:viewController];
}
else
{
[window addSubview:viewController.view];
}
}
#pragma mark -
#pragma mark iOS 6 Fix
//iOS 6
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 60000
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}
- (BOOL)shouldAutorotate {
return YES;
}
#endif
#endif
#pragma mark End iOS 6 Fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment