我在
github年遵循了Alamofire的指示,
我创建了一个名为cocoapods-test&我关了
我去项目文件夹运行pod init命令生成一个Podfile.然后我将以下代码添加到Podfile中:
source 'https://github.com/CocoaPods/Specs.git' platform :ios,'8.0' use_frameworks! pod 'Alamofire','~> 3.0'
然后,我运行命令pod安装,这是终端的结果:
Updating local specs repositories CocoaPods 1.0.0.beta.6 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. Analyzing dependencies Downloading dependencies Installing Alamofire (3.3.0) Generating Pods project Integrating client project [!] Please close any current Xcode sessions and use `cocoapods-test.xcworkspace` for this project from now on. Sending stats Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
然后,在我的项目文件夹中有一个名为cocoapods-test.xcworkspace的新文件.我双击它再次打开我的xcode,我可以看到Alamofire模块.
然后,我打开我的项目的ViewController类,并导入Alamofire.但无论多少次我清洁&构建,我总是得到错误没有这样的模块’Alamofire’.这是截图:
为什么我得到这个问题,虽然我按照指示一步一步?
(我正在使用XCode 7.2.1,Swift 2.1.1和Alamofire 3.3.0)
=======更新========
我试过@LK杨的答案,拒绝进口Alamofire,然后清洁&再次构建,我从Alarmofire收到一堆编译器错误: