【发布时间】:2018-05-10 12:27:53
【问题描述】:
我刚刚写了一个 cocoapod 并发布了它。在本地,它适用于该示例。
但是,当我尝试通过“pod install”安装并使用它时,加载 XIB 文件时出现问题。
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle:
我目前正在像这样加载 XIB 文件:
NSString* const frameworkBundleID = @"org.cocoapods.MyPod";
NSBundle *podBundle =[NSBundle bundleWithIdentifier:frameworkBundleID];
之前我也尝试过(如下),它也可以在本地工作。
NSBundle *podBundle = [NSBundle bundleForClass:[self class]];
我做错了什么,使它在本地工作,但在发布后不能工作?
仅供参考,以下是规范的外观:
s.source_files = 'Pod/Classes/**/*.{h,m}'
s.resource_bundles = {
'NetLogger' => ['Pod/Assets/*.xcassets', 'Pod/Classes/*.xib']
}
【问题讨论】:
标签: ios objective-c cocoapods