【问题标题】:Fail to load static library bundle storyboard (not yet loaded) - iOS无法加载静态库捆绑故事板(尚未加载) - iOS
【发布时间】:2017-08-31 21:27:16
【问题描述】:

我想构建一个静态库,其中包含带有故事板的捆绑包。

当我创建一个示例项目并导入 bundle 和 .h 文件并运行它时,我收到如下错误:

 </Users/admin/Library/Developer/CoreSimulator/Devices/428755C3-5E9A-451F-AEAE-5BBD33506812/data/Containers/Bundle/Application/E3535CCC-F995-48E2-A26C-D8771E2109A1/testLibApp.app/testLibResources.bundle> (not yet loaded)

这里我调用了静态库,想要呈现故事板视图:

NSString *pathAndFileName = [[NSBundle mainBundle] pathForResource:@"testLibResources" ofType:@"bundle"];

NSBundle *resourceBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"testLibResources" ofType:@"bundle"]];

NSString *pathAndFileName = [resourceBundle pathForResource:@"testLib" ofType:@"storyboard"];

当代码运行时,它会崩溃并显示如上的错误日志:

[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"testLibResources" ofType:@"bundle"]];

有人知道如何加载静态库捆绑故事板并将其呈现给当前视图吗?

我还检查了构建阶段,捆绑包已添加到捆绑包资源中:

【问题讨论】:

    标签: ios storyboard bundle static-libraries xcode8


    【解决方案1】:

    我遇到了同样的问题,可以通过从 Xcode 中删除派生数据文件夹(Xcode / Preferences / Locations / Derived Data)来解决它。同时从设备中删除该应用程序。

    【讨论】:

      猜你喜欢
      • 2012-01-30
      • 1970-01-01
      • 1970-01-01
      • 2022-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-15
      • 2016-12-17
      相关资源
      最近更新 更多