直接跳過安裝cocopods。
1.新建一個(gè)項(xiàng)目。
2.cd到項(xiàng)目總目錄
$ cd /users/Desktop/Project
3.建立Podfile(配置文件)
$ vim Podfile
鍵盤輸入 i ,進(jìn)入編輯模式,輸入
platform :ios, '8.0'
#use_frameworks!個(gè)別需要用到它,比如reactiveCocoa
target 'APPTest' do
pod 'AFNetworking', '~> 3.1.0'
pod 'MJRefresh','~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5'
end
或者另外一種寫法:
platform :ios, '8.0'
#use_frameworks!個(gè)別需要用到它,比如reactiveCocoa
def pods
pod 'AFNetworking', '~> 3.1.0'
pod 'MJRefresh','~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5'
end
target ‘APPTest’ do
pods
end
按Esc,輸入 “ :” 號進(jìn)入vim命令模式,然后在冒號后邊輸入wq(回車后發(fā)現(xiàn)PodTest項(xiàng)目總目錄中多一個(gè)Podfile文件)
4.安裝。
$ pod install
-注意:之前在第三步輸入的是
platform :ios, '8.0'
pod 'AFNetworking', '~> 3.1.0'
pod 'MJRefresh','~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5'
出現(xiàn)報(bào)錯(cuò):
[!] The dependency `AFNetworking (~> 3.1.0)` is not used in any concrete target.
The dependency `MJRefresh (~> 3.1.0)` is not used in any concrete target.
The dependency `SDWebImage (~> 3.7.5)` is not used in any concrete target.
百度了一下,更改為之上的步驟。解決了問題。