CocoaPods的安装网上方法很多,这里就不说明了,这里介绍一下使用方法安装方法1.CocoaPods安装后使用终端cd到项目总目录(注意:包含PodTest文件夹、PodTest.xcodeproj、PodTestTest的那个总目录),输入 vim Podfile命令创建Podfile文件

按回车后会显示下面的编辑框

我们输入i进入编辑模式,比如要加入MBProgressHUD,AFNetworking,MJRefresh可以这样输入:

然后按esc键,接着输入:wq,然后回车,项目中就多了一个Podfile文件
2.打开终端cd到项目总目录,然后输入 pod install,等待一会,成功后我们的项目目录会变成这样:

注意:现在打开项目不是点击 MyPodsTest.xodeproj了,而是点击 MyPodsTest.xcworkspace文件了
Note:

网友评论