iOS 6 업그레이드 할때 주의점!
iOS 6 Tips and Tricks Upgrading Your Apps
Here is what I have learned so far upgrading our apps to iOS 6. Figure this will help some people out. Orientation support is instantly broken the minute I built my apps against iOS 6.
Root View Controller warning?
Warning:
Application windows are expected to have a root view controller at the end of application launch
Change in app delegate didFinishLaunchingWithOptions:
[window addSubview:navigationController.view];
To:
[window setRootViewController:navigationController];
iOS 6 New Orientation Methods
Set orientation in Info.plist or Summary screen. Then add following code to root view controller class only. Note that if you add a navigation controller to your window, in your app delegate’s didFinishLaunchingWithOptions, you need to create a class that has a subclass of UINavigationController and change your class to this type.
- (BOOL)shouldAutorotate {
return YES;
}
\\replaces – (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return UIInterfaceOrientationLandscapeRight;
}
The preferredInterfaceOrientationForPresentation method will rotate your view to whatever you set it to when a view is loaded. Be careful as when you come back to your view it may be upside down. Do not include this method if you don’t want it to override the current orientation when you dismiss say a UIImagePickerController.
UIImagePickerController crash
Crash:
Terminating app due to uncaught exception ‘UIApplicationInvalidInterfaceOrientation’, reason: ‘Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES’
Add to app delegate:
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)w {
return (NSUInteger)[application supportedInterfaceOrientationsForWindow:w] | (1<<UIInterfaceOrientationPortrait);
}
Test for iOS Version
Here is the best way to test for iOS Version:
NSString *reqSysVer = @”6.0″;
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];
BOOL versionHigher = [currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending;
New iPhone 5 screen dimensions
Warning:
Missing “Default-568h@2x.png” launch image
Once you create this file, the letter boxing will disappear. XCode will even ask you if you want it to create the file.
Depending on your screens layouts, you may just have to make sure your MainWindow.xib is set to Full Screen at Launch. Otherwise you may have to do specific layouts for just the iPhone 5.
출처 : http://grembe.wordpress.com/2012/09/19/here-is-what-i/
'cocos2d-x' 카테고리의 다른 글
CCLabelBMFont 사용시 주의 점. (3) | 2013.04.24 |
---|---|
[cocos2dx] 특이 에러 make warning: NUL character seen; rest of line ignored (1) | 2012.07.10 |
[cocos2dx] SDK 설치 설정 (0) | 2012.07.08 |
[cocos2dx] 터치 & 멀티 터치 (0) | 2012.07.06 |
[cocos2dx] 화면 해상도 고정시키기 (2) | 2012.07.05 |