首页 文章

无法加载静态库包故事板(尚未加载) - iOS

提问于
浏览
1

我想构建一个包含故事板包的静态库 .

当我创建一个示例项目并导入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”]];

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

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

1 回答

  • -1

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

相关问题