【发布时间】: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