iOS必学技-cocoapods

时间:2023-03-08 23:33:13
iOS必学技-cocoapods

我就不再造*了,网上的教程很详细,楼主亲测,好用.

http://code4app.com/article/cocoapods-install-usage

楼主安装使用过程中遇到以下几个问题,同学们在安装过程中遇到同样问题,可以回头看这里:

1 最后一个步骤,终端输入命令行

pod install

楼主终端出现这样的代码:

Analyzing dependencies

CocoaPods 0.37..rc. is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try. For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ. Downloading dependencies
Using AFNetworking (2.5.)
Generating Pods project
Integrating client project

没有关键的这句话:

[!] From now on use `CocoaPodsDemo.xcworkspace`.

而且,项目代码中没有CocoaPodsDemo.xcworkspace这个文件

+++++++++++++++++++++++++++

解决方案:

a,先执行

pod update

b,再执行

pod install

完美解决。

小结:

如何安装cocoapods
更新gem:
命令 sudo gem update —system
*
$ gem sources --remove https://rubygems.org/
//等有反应之后再敲入以下命令
$ gem sources -a http://ruby.taobao.org/
安装cocoapods
命令 sudo gem install cocoapods
cocoapods 设置
命令 pod setup
cd 到工程根目录创建podfile文件
命令 vim Podfile
编辑 Podfile内容
platform :ios, '7.0'
pod "AFNetworking", "~> 2.0”
:wq 保存退出
pod install