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?


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];


[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


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


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.

Posted in Uncategorized | Tagged , , , , | 15 Comments

Grembe Apps Consulting

We are starting Grembe Apps Consulting – Building apps that make a difference. Please email us if you have a project or idea that you want to bring to the iPhone, iPad, or Android OS. We know the excitement of turning an idea into reality and seeing how it grows. Let us bring your app to life.

Posted in Uncategorized | Leave a comment