【问题标题】:Create multiple storyboard iPhone/ipad创建多个故事板 iPhone/ipad
【发布时间】:2014-03-05 10:37:00
【问题描述】:

创建多个storyboard iPhone/ipad,使用同一个viewcontroller,但iPhone storyboard可以运行,iPad报错信息(可以在ios模拟器上运行,但不能在我的ipadair上运行)。

这是我的代码:

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.

【问题讨论】:

    标签: ios iphone objective-c ipad


    【解决方案1】:

    确保您已将文件包含到应用程序包的目标中。确保您已检查目标成员资格。

    【讨论】:

    • 是的,我已经检查了目标会员
    【解决方案2】:

    将您的视图控制器添加到您的构建阶段。

    1. 再次清理并重建它。它应该可以工作。

    2. 如果不行就重置模拟器再试试

    3. 重命名您的视图控制器文件和类名,然后将其添加到您的项目中。

    【讨论】:

      【解决方案3】:

      iPadAir必须支持(64位),使用旧项目不要改变

      【讨论】:

        猜你喜欢
        • 2014-05-20
        • 2015-09-20
        • 1970-01-01
        • 1970-01-01
        • 2013-11-16
        • 1970-01-01
        • 2014-11-22
        • 2012-11-16
        • 2016-08-10
        相关资源
        最近更新 更多