Xcode iPhone device plays different version from iPhone Simulator

↘锁芯ラ 提交于 2020-01-22 03:17:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!