问题
I created an iPhone 6 class and iPhone 5 class. In app delegate I used the following code for each size to be recognized...
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
CGSize iosScreenSize = [[UIScreen mainScreen] bounds].size;
if (iosScreenSize.height ==568) {
UIStoryboard *iPhone5 =[UIStoryboard storyboardWithName:@"iPhone5" bundle:nil];
UIViewController *initialViewController =[iPhone5 instantiateInitialViewController];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
if (iosScreenSize.height == 667) {
UIStoryboard *iPhone6 = [UIStoryboard storyboardWithName:@"iPhone6" bundle:nil];
UIViewController *initialViewController =[iPhone6 instantiateInitialViewController];
self.window.rootViewController = initialViewController;
[self.window makeKeyAndVisible];
}
return YES;
}
The simulator picks up iPhone 5 storyboard when needed and iPhone 6 storyboard when needed however, the device picks the wrong storyboard. When I use the iPhone 6 device, Xcode plays my iPhone 5 storyboard on iPhone 6 device. How do I get Xcode to play my iPhone 6 storyboard on iPhone 6 device?
来源:https://stackoverflow.com/questions/35279340/xcode-iphone-device-plays-different-version-from-iphone-simulator