我正在努力争取资源。 我希望能够在我的吊舱里放一个nib 。 其中一个类使用此nib 。
这是podspec:
Pod::Spec.new do |s| s.name = "MyCBD_BSManagedDocument" s.requires_arc = true s.osx.platform = :osx, '10.7' s.subspec 'MyCBD_BSManagedDocument' do |ss| ss.source_files = 'Classes/MyCBD_BSManagedDocument/**/*.{h,m}' end s.subspec 'Auxiliary classes' do |ss| ss.subspec 'MyCBDLockManager' do |sss| sss.source_files = 'Classes/Auxiliary classes/MyCBDLockManager/**/*.{h,m}' sss.resource_bundle = {'MyCBDLockManager' => 'Classes/Auxiliary classes/MyCBDLockManager/MyCBDLockManager.xib'} end ss.subspec 'MyCBDSafeguardManager' do |sss| sss.source_files = 'Classes/Auxiliary classes/MyCBDSafeguardManager/**/*.{h,m}' end end end非常奇怪的是,在我的玩具项目中测试pod,它可以工作(我可以检查nib是在mainBundle ),但是在我的实际项目中,nib不在mainBundle中,我有错误
-[MyCBDLockManager loadWindow]: failed to load window nib file 'MyCBDLockManager'.关于如何用可可豆荚包含资源的任何建议?
I am struggling with resources. I want to be able to put a nib in my pod. One of the classes uses this nib.
Here is the podspec:
Pod::Spec.new do |s| s.name = "MyCBD_BSManagedDocument" s.requires_arc = true s.osx.platform = :osx, '10.7' s.subspec 'MyCBD_BSManagedDocument' do |ss| ss.source_files = 'Classes/MyCBD_BSManagedDocument/**/*.{h,m}' end s.subspec 'Auxiliary classes' do |ss| ss.subspec 'MyCBDLockManager' do |sss| sss.source_files = 'Classes/Auxiliary classes/MyCBDLockManager/**/*.{h,m}' sss.resource_bundle = {'MyCBDLockManager' => 'Classes/Auxiliary classes/MyCBDLockManager/MyCBDLockManager.xib'} end ss.subspec 'MyCBDSafeguardManager' do |sss| sss.source_files = 'Classes/Auxiliary classes/MyCBDSafeguardManager/**/*.{h,m}' end end endVery strangely, in my toy-project to test the pod, it works (I can check the nib is in the mainBundle), but in my real project, the nib is not in the mainBundle, and I have the error
-[MyCBDLockManager loadWindow]: failed to load window nib file 'MyCBDLockManager'.Any advice on how to include resources with cocoa pods?
最满意答案
出于某种原因,构建阶段中的一个阶段缺失。 不过我不知道为什么。 因此,我不得不再次使用pod install添加此阶段。
For some reason, one phase in the build phases was missing. I don't know why, though. So, I had to add this phase again with pod install.
更多推荐
发布评论