Xcode iPhone设备在iPhone模拟器中播放不同版本

时间:2016-02-08 21:06:57

标签: ios xcode storyboard

我创建了一个iPhone 6类和iPhone 5类。在app delegate中,我使用以下代码来识别每个大小...

- (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;
    }

模拟器在需要时选择iPhone 5故事板,然后在需要时选择iPhone 6故事板,但设备会选择错误的故事板。当我使用iPhone 6设备时,Xcode在iPhone 6设备上播放我的iPhone 5故事板。如何让Xcode在iPhone 6设备上播放我的iPhone 6故事板?

0 个答案:

没有答案