我创建了自己的
CocoaPods Pod以在内部用于我的应用程序.此Pod还应使用Core Data.我将我的文件xy.xcdatamodeld添加到我的源文件中,但它没有编译到xy.momd文件夹中.
我是否需要在Pod中设置任何其他属性才能使Core Data正常工作?
我目前的pod文件:
Pod::Spec.new do |s| s.name = "Test" s.version = "1.0" s.summary = "..." s.homepage = "..." s.license = 'MIT (example)' s.author = { "Felix Krause" => "xy@xy.com" } s.source = { :git => "http://EXAMPLE/Example.podspec.git",:tag => "0.0.1" } s.platform = :ios,'6.0' s.source_files = 'TS/Classes/**/*.{h,m}','TS/Views/**/*.{h,'TS/TSResources/**/*.{json,xcdatamodeld}' s.resources = "TS/TSResources/**/*" s.frameworks = 'CoreData','QuartzCore','Accounts','MessageUI','CoreLocation','CoreGraphics','MobileCoreServices','SystemConfiguration' s.requires_arc = true s.ios.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(PODS_ROOT)/../../TS/**' } s.ios.xcconfig ={ 'FRAMEWORK_SEARCH_PATHS' => '"$(PODS_ROOT)/../.." "$(PODS_ROOT)/.." "$(SRCROOT)/.."' } s.xcconfig = { 'OTHER_LDFLAGS' => '-all_load' } s.dependency 'JSONKit' end
解决方法
所以我可以回到这个,它实际上是支持的.您需要做的就是确保您的pod规范列出资源下的.xcdatamodeld.有效的东西:
Pod::Spec.new do |s| s.name = "MyPod" s.version = "0.1" s.platform = :ios,'8.0' s.requires_arc = true s.public_header_files = 'Pod/Classes/**/*.h' s.source_files = 'Pod/Classes/**/*{h,m}' s.resources = 'Pod/Classes/CoreData/*.xcdatamodeld' s.frameworks = 'CoreData' end