CocoaPods安装及使用 && ReactiveCocoa开发框架的导入

  

 

// CocoaPods搭建

如何安装?

$ gem sources --remove https://rubygems.org/

$ gem sources -a https://ruby.taobao.org/

$ gem sources -l

*** CURRENT SOURCES ***

https://ruby.taobao.org

$ sudo gem install cocoapods

...

$ sudo xcode-select -switch /Applications/Xcode.app/  //指定Xcode的路径

$ pod setup

 

出现Setting up CocoaPods master repo,半天没有任何反应。原因无他,因为那堵墙阻挡了cocoapods.org。。。

gitcafeoschina都是国内的服务器,可以用它们CocoaPods索引库的镜像:

$ pod repo remove master

$ pod repo add master https://gitcafe.com/akuandev/Specs.git

$ pod repo update

如果想用oschina的镜像也可以把第二条命令 换成 http://git.oschina.net/akuandev/Specs.git 即可

----------------------------------------------------------------------------------------------------------------------

// CocoaPods使用方法

/*CocoaPods 的使用

1、创建Podfile

终端:进入工程的根目录,创建空白的Podfile文件
1、cd /*工程根路径*/
2、touch Podfile

2、编辑Podfile

platform :ios, '7.0'
pod "ReactiveCocoa"

 

查找第三方库 pod search AFNetworking
更新第三方库 pod update

3、执行导入命令

终端:进入工程根目录,执行pod install命令,CocoaPods开始下载所需框架
1、cd /*工程根路径*/
2、pod install

----------------------------------------------------------------------------------------------------------------------

posted @ 2015-12-08 18:19  J了个M  阅读(204)  评论(0)    收藏  举报