我想在
Swift中使用cocoapod Alamofire.但是,当我导入Alamofire时,我收到错误“No Such Module”我正在使用Xcode 7.2 Alamofire 3.0和Swift 2以下是我采取的步骤
1)在终端我跑了
$sudo gem install cocoapods
那时没有错误
2)我跑了
cd~ / Path / To / Folder / Containing / Project(一次在我运行的项目文件夹中)
pod init
3)然后
open -a Xcode Podfile
4)然后我补充说
source 'https://github.com/CocoaPods/Specs.git' platform :ios,'8.0' use_frameworks! pod 'Alamofire','~> 3.0'
到Podfile
5)然后我跑了
pod 'Alamofire','3.0'
其次是
pod install
我将$(SRCROOT)添加到runpath和buildpath.
另外我发现这个答案No such module “Armchair”说添加预发布但我真的不明白如何做到这一点或者这是我的问题.也许这是显而易见的,但我是Swift的新手并且不理解.
Alamofire也应该出现在我的框架或pods文件夹中吗?它不在任何一个.
files in project
解决方法
在pod init之后,您必须使用新的< YourProject> .xcworkspace而不是< YourProject> .xcodeproj.
pod安装后,xcworkspace包含您的项目和pod.