創建多個故事板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.
是的,我已經檢查了目標會員 –
對於任何一個設備( iPhone/iPad)的作品? – Rajesh
iPhone可以工作,只有iPad有錯誤信息 –