How to switch to different Storyboard for iPhone 5?

I was looking for the same answer couple of weeks ago here’s my solution hope helps.. -(void)initializeStoryBoardBasedOnScreenSize { if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { // The iOS device = iPhone or iPod Touch CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size; if (iOSDeviceScreenSize.height == 480) { // iPhone 3GS, 4, and 4S and iPod Touch 3rd and … Read more

Attempt to present * on * whose view is not in the window hierarchy

You can’t display a modal view controller from the appDelegate. You need to display a modal ViewController from whichever viewController is currently displaying full-screen. In other words, you need to put that code into your root view controller, or whichever one you want to display the modal vc from… Also, you’ll want to use the … Read more

Replacement for “purpose” property of CLLocationManager

The replacement for the purpose property in iOS 6 is a new Info.plist key named NSLocationUsageDescription (aka “Privacy – Location Usage Description”). The key is documented in the Information Property List Key Reference but unfortunately it’s not mentioned with the deprecation note of the purpose property. However, the CLLocationManager.h does have this comment: * Deprecated. … Read more

nib but didn’t get a UITableView

If you have a NIB for the UITableViewController subclass then its view outlet must be hooked up to a UITableView. You’re right to delete MainListViewController.xib and do it all in code, but the reason it didn’t work for you is because the old XIB will not be deleted when you build & run. So, delete … Read more

Could not insert new outlet connection [duplicate]

I got the same problem as you today… I think this is a bug of Xcode, below is the way to fix the issue: Close the project you are working on with. Delete your project’s【DerivedData】folder. (This folder may inside your project’s folder, or inside ~/Library/Developer/Xcode/DerivedData/(your project)/ ) or somewhere else that was setup by you. … Read more

GameCenter authentication in landscape-only app throws UIApplicationInvalidInterfaceOrientation

While writing this question and experimenting with code, it seems that I’ve found a solution: enable all orientations in project summary and remove application:supportedInterfaceOrientationsForWindow. Add this code to ViewController: – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } Now it works seamlessly.

preferredInterfaceOrientationForPresentation must return a supported interface orientation

Your code should look like this: -(BOOL)shouldAutorotate { return NO; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationLandscapeRight; } Also, make sure in your Info.plist you have set the correct orientations for you app because what you return from supportedInterfaceOrientations is intersected with the Info.plist and if it can’t find a common … Read more