2014-03-04 60 views
0

創建多個故事板iPhone/ipad,使用相同的viewcontroller,但iPhone storyboad可以運行,iPad錯誤消息(可以在ios模擬器上運行,但不能在我的ipadair上運行)。創建多個故事板iPhone/ipad

這是我的代碼:

NSBundle *resource = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"LibraryResource" ofType:@"bundle"]]; 
[resource load]; 

    UIUserInterfaceIdiom userIdiom = [[UIDevice currentDevice] userInterfaceIdiom]; 
    if (userIdiom == UIUserInterfaceIdiomPad) { 
     UIStoryboard* mainStoryboard = [UIStoryboard storyboardWithName:@"Main_iPad" bundle:resource]; 
     LibraryController* LibraryController = [mainStoryboard instantiateViewControllerWithIdentifier:@"LibraryController"]; 
     [self presentViewController:LibraryController animated:YES completion:nil]; 
    } else if (userIdiom == UIUserInterfaceIdiomPhone) { 
     UIStoryboard* mainStoryboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:resource]; 
     LibraryController* LibraryController = [mainStoryboard instantiateViewControllerWithIdentifier:@"LibraryController"]; 
     [self presentViewController:LibraryController animated:YES completion:nil]; 
    } 

錯誤消息:

2014-03-04 14:24:25.515 AddLibrary[311:60b] Cannot find executable for CFBundle/CFPlugIn 0x157e0aad0 </var/mobile/Applications/184A78F9-1488-4C34-AD5C-10170067ACEA/AddLibrary.app/Library9898API Resource.bundle> (not loaded) 
2014-03-04 14:24:25.522 AddLibrary[311:60b] Unknown class LibraryController in Interface Builder file. 

回答

0

確保您已包括您的文件到您的目標是你的應用程序包。確保您已經檢查了目標會員資格。

enter image description here

+0

是的,我已經檢查了目標會員 –

+0

對於任何一個設備( iPhone/iPad)的作品? – Rajesh

+0

iPhone可以工作,只有iPad有錯誤信息 –

0

您的視圖控制器添加到您的構建階段。

  1. 清理並重新構建它。它應該工作。

  2. 如果不是那麼重那麼模擬器嘗試

  3. 重命名您的視圖控制器文件和類名,然後將其添加您的項目。

enter image description here

+0

我可以在模擬器上工作,但在我的ipadAir上不工作 –

0

iPadAir必須支持(64位),使用舊的項目不會改變

enter image description here