2014-11-09 84 views
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消息,但故事板不加載和「應用程序窗口...」出現錯誤。

我使用了一些滾動視圖和一些元素,但我認爲這些不是問題,因爲有一個選項「調整滾動視圖插圖」。

我上傳了一些屏幕截圖,以顯示更多關於我的項目。謝謝你的時間。

enter image description here enter image description here enter image description here

回答

0

我想通了。當您將所有東西從Iphone故事板複製到Ipad時,初始視圖控制器複選框未被選中。只是檢查它,一切都會很好(:

相關問題