希望有一种方式能够在SPEC中配置混编ARC,MRC
业精于勤,荒于嬉;行成于思,毁于随。
使用subspec(子模組配置),每個子模組中可以各自設置,決定是否使用ARC 詳細說明看一下官方文件Podspec Syntax Reference 下面是一個例子,做的是百度地圖2.8的API,其中我擴展了一些方法。 例子中,其中BaiduMapAPI/Core不支援ARC,BaiduMapAPI/Extend支援ARC,預設載入All,All中依賴BaiduMapAPI/Core和BaiduMapAPI/Extend這樣就可以在預設情況下將完整的庫引入項目:
subspec
ARC
BaiduMapAPI/Core
BaiduMapAPI/Extend
All
Pod::Spec.new do |s| s.name = 'BaiduMapAPI' s.version = '2.8.0' s.license = { :type => 'Copyright', :text => 'LICENSE ©2013 Baidu, Inc. All rights reserved.' } s.summary = 'Baidu Map API For iOS.' s.homepage = 'http://developer.baidu.com/map/index.php?title=iossdk' s.authors = { 'Steven' => 'qzs21@qq.com' } s.source = { :git => 'https://github.com/qzs21/BaiduMapAPI.git', :tag => s.version } s.ios.deployment_target = '5.0' s.default_subspec = 'All' s.subspec 'All' do |spec| spec.ios.dependency 'BaiduMapAPI/Core' spec.ios.dependency 'BaiduMapAPI/Extend' end s.subspec 'Core' do |spec| spec.requires_arc = false spec.compiler_flags = '-ObjC' spec.resources = 'Framework/Resources/mapapi.bundle' spec.ios.vendored_frameworks = 'Framework/BaiduMapAPI.framework' spec.public_header_files = [ 'Framework/BaiduMapAPI.framework/Headers/*.h' ] spec.frameworks = [ 'UIKit', 'CoreLocation', 'QuartzCore', 'OpenGLES', 'SystemConfiguration', 'CoreGraphics', 'Security' ] spec.libraries = [ "stdc++", "stdc++.6" ] end s.subspec 'Extend' do |spec| spec.requires_arc = true spec.public_header_files = [ 'Framework/Extend/*.h' ] spec.source_files = [ 'Framework/Extend/*.{h,mm,m}' ] spec.ios.dependency 'BaiduMapAPI/Core' end end
spec.ios.vendored_frameworks 我在提交時,告訴我,我的路徑找不到該文件,但是,路徑是正確的。
我在spec檔案裡 指定vendored_frameworks 路徑也沒有就問題 但是編譯工程的時候提示 file not found 請問怎麼解決才好
使用
subspec
(子模組配置),每個子模組中可以各自設置,決定是否使用ARC
詳細說明看一下官方文件Podspec Syntax Reference
下面是一個例子,做的是百度地圖2.8的API,其中我擴展了一些方法。
例子中,其中
BaiduMapAPI/Core
不支援ARC
,BaiduMapAPI/Extend
支援ARC
,預設載入All
,All
中依賴BaiduMapAPI/Core
和BaiduMapAPI/Extend
這樣就可以在預設情況下將完整的庫引入項目:spec.ios.vendored_frameworks 我在提交時,告訴我,我的路徑找不到該文件,但是,路徑是正確的。
我在spec檔案裡 指定vendored_frameworks 路徑也沒有就問題 但是編譯工程的時候提示 file not found 請問怎麼解決才好