我在AppDelegate.m中使用以下代码来检测用户正在使用的设备:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
NSLog(@"iPhone 3,5 Inch");
[UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
}
if(result.height == 568)
{
NSLog(@"iPhone 4 Inch");
[UIStoryboard storyboardWithName:@"iPhone5-storyboard" bundle:nil];
}
}
return YES;
}
但是当我构建应用程序时,会显示 NSLog,但没有出现 Storyboard ......
- 部署信息中的 Main Storyboard 字段为空,因此代码决定加载什么...
你能帮助我吗?