加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – 无法访问自己的CocoaPods Pod核心数据文件

发布时间:2020-12-16 07:53:11 所属栏目:百科 来源:网络整理
导读:我创建了自己的 CocoaPods Pod以在内部用于我的应用程序.此Pod还应使用Core Data.我将我的文件xy.xcdatamodeld添加到我的源文件中,但它没有编译到xy.momd文件夹中. 我是否需要在Pod中设置任何其他属性才能使Core Data正常工作? 我目前的pod文件: Pod::Spec
我创建了自己的 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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读