我正在使用RestKit,它使用不同的podfile。我想知道该示例应用程序中使用的podfile版本是哪个。并且还想知道如何通过终端更新podfile?
问题1:
如果pod已安装,进入pod的info.plist文件,可以看到已安装pod的版本。
问题2: 要通过终端更新 podfile,请使用
打开 podfilevi podfile
单击“i”即可在 podfile 中编辑或插入项目。要保存更改,请使用
click esc then :wq!
运行
pod update
更新更改。
您可以在项目的 podspec 文件中了解这一点。对于您的情况,它是 RestKit 的 podspec :
Pod::Spec.new do |s|
s.name = 'RestKit'
s.version = '0.24.1'
s.summary = 'RestKit is a framework for consuming and modeling RESTful web resources on iOS and OS X.'
s.homepage = 'https://github.com/RestKit/RestKit'
s.social_media_url = 'https://twitter.com/RestKit'
s.author = { 'Blake Watters' => '[email protected]' }
s.source = { :git => 'https://github.com/RestKit/RestKit.git', :tag => "v#{s.version}" }
s.license = 'Apache License, Version 2.0'
... ... ...
当你像这样在 Podfile 中使用时:
pod“RestKit”
它将自动获取最新发布的版本!。对于您的情况,这是项目 podspec 文件中的这一行:
s.version = '0.24.1'
但是如果您想使用此行决定要安装哪个版本:
pod 'RestKit', '~> 0.24.0'
您可以使用此命令更新 Pod :
pod update
希望现在一切都清楚了。