iPad simulator/device uses iPhone storyboard
ipad, iphone, objective-c, xcode
Solution
You could always pick the proper storyboard in the appDelegate and present the appropriate root view controller programatically
@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
UIViewController *rvc;
}
Implementation
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"IPAD_Storyboard" bundle:nil];
rvc = [storyboard instantiateViewControllerWithIdentifier:@"identifierForController"];
}
else {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
rvc = [storyboard instantiateViewControllerWithIdentifier:@"identifierForController"];
}
[self.window addSubview:rvc.view];
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
Problem
So I've created an app for iPhone and I wanted to convert it to iPad, by following steps from this answer. Duplicate your iPhone-Storyboard and rename it MainStoryboard_iPad.storyboard Open this file any text editor. Search for targetRuntime="iOS.CocoaTouch"and change it to targetRuntime="iOS.CocoaTouch.iPad" Now save everything and reopen Xcode -> the iPad-Storyboard contains the same as the iPhone-file but everyting could be disarranged Everything is done correctly but iPad simulator/device anyways uses iPhone storyboard. Any suggestions? I've set iPad storyboard in summary->ipad deployment info->Main storyboard. And main.plist-> Main storyboard file base name (iPad) is set to iPad storyboard. Please tell me what I am missing. UPD. Interesting Thing, when I delete iPad storyboard name from ipad deployment info it still uses my iPhone storyboard on device.