![](/img/trans.png)
[英]Cannot access storyboard in resource bundle file inside iOS static library
[英]Fail to load static library bundle storyboard (not yet loaded) - iOS
我想建立一个静态库,其中包括与故事板捆绑在一起。
创建示例项目并导入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”]]];
有人可以知道如何加载静态库捆绑情节提要板并将其呈现给当前视图吗?
我有同样的问题,可以通过从Xcode(Xcode / Preferences / Locations / DerivedData)中删除派生数据文件夹来解决。 同时从设备中删除该应用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.