我想:
我已经看了一些教程,但我仍然没有得到它,有人可以输入/显示需要在应用代理中执行这些目标的代码。
谢谢!
答案 0 :(得分:4)
在你的app delegate中尝试这样的事情:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIStoryboard *storyboard = nil;
if([[UIDevice currentDevice]userInterfaceIdiom]==UIUserInterfaceIdiomPhone)
{
if ([[UIScreen mainScreen] bounds].size.height == 568.0f)
{
storyboard = [UIStoryboard storyboardWithName:@"iPhone5s" bundle:nil];
}
else
{
storyboard = [UIStoryboard storyboardWithName:@"iPhone4" bundle:nil];
}
}
else
{
storyboard = [UIStoryboard storyboardWithName:@"iPad" bundle:nil];
}
[window setRootViewController:[storyboard instantiateInitialViewController]];
[window makeKeyAndVisible];
}