0
我为Iphone和Ipad加载了不同的故事板,Iphone的故事板加载良好,但是当我启动Ipad Simulator时,我得到了“应用程序窗口” ..“错误。“应用程序窗口预计......”为Ipad加载故事板时出错
这是AppDelegate中的代码:
@implementation AppDelegate
- (UIStoryboard *)grabStoryboard {
UIStoryboard *storyboard;
// detect the height of our screen
int height = [UIScreen mainScreen].bounds.size.height;
if (height == 480) {
storyboard = [UIStoryboard storyboardWithName:@"Storyboard_Iphone3" bundle:nil];
// NSLog(@"Device has a 3.5inch Display.");
}
if (height >= 1024 && height <= 2048) {
storyboard = [UIStoryboard storyboardWithName:@"Storyboard_Ipad" bundle:nil];
NSLog(@"Device has a 4inch Display.");
}
else {
storyboard = [UIStoryboard storyboardWithName:@"Storyboard_Iphone4Up" bundle:nil];
// NSLog(@"Device has a 4inch Display.");
}
return storyboard;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *storyboard = [self grabStoryboard];
// show the storyboard
self.window.rootViewController = [storyboard instantiateInitialViewController];
[self.window makeKeyAndVisible];
return YES;
}
在控制台中我看到的NSLog消息,但故事板不加载和“应用程序窗口...”出现错误。
我使用了一些滚动视图和一些元素,但我认为这些不是问题,因为有一个选项“调整滚动视图插图”。
我上传了一些屏幕截图,以显示更多关于我的项目。谢谢你的时间。