ios - Alamofire Xcode 8 Swift 3 导致 786 个编译错误

标签 ios swift xcode cocoapods alamofire

我使用的是 Xcode 8.0 GM。我创建了一个默认的单 View 应用程序,并将我的部署目标设置为 9.0。

在我的 Podfile 中,我的目标是最先进的 Swift 3 分支:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target 'MyProject' do
    pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift3'
end

我运行 pod install 并得到 ... 正在安装 Alamofire (4.0.0-beta.2) ... 太棒了,没问题。我打开 MyProject.xcworkspace

弹出:

convert Alamofire to latest syntax

我不能稍后再打,因为它告诉我:

Xcode 8 will not be able to build the target “Alamofire”, and certain editing features will not function properly until the Swift source code in this target has been converted.

那不行,我想建一个。所以我点击“转换”。它给了我选择:

convert to Swift 3

这就是我想要的,Swift 3。看起来不错,我点击“下一步”。

select targets

它默认为这 3 个选定的目标。好吧好吧,我接着打。

error 1 error 2

以上帝的名义……

我想在针对 iOS 9.0 的 Xcode 8、Swift 3 项目上使用 Alamofire 的 swift3 前沿分支。我哪里出错了,我怎样才能让它工作? FWIW 我在尝试使用 Alamofire 的 Swift 2.3 分支时遇到了一堆错误,所以我知道这是我做错了什么。

最佳答案

通过命令升级到最新的 Cocoapods(在回答这个问题时:版本 1.1.0.beta.2):

gem install cocoapods --pre 似乎解决了我的情况。

关于ios - Alamofire Xcode 8 Swift 3 导致 786 个编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39380939/

相关文章:

ios - 应用程序在 iOS 8.1.3 上崩溃,无法重现问题

xcode - 全屏退出后模态 NSWindow 消失

ios - 滚动时 UITableView 奇怪的布局行为发生变化

ios - 通过 WhatsApp 共享 PDF

c++ - 由于 ____chkstk_darwin,在 Catalina 上使用 Deployment 10.10 编译的 MacOS 应用程序在 < HighSierra 版本上崩溃

iphone - 如何在 iOS5 上运行 iOS 4.3.3 开发的应用程序?

ios - CNCopyCurrentNetworkInfo 不适用于 iOS 14

iphone - ViewDidLoad 方法不保留变量?

iphone - UIImagePickerController 错误

ios - 通过 UIAlertController 登录/注册