我正在使用 Xcode 9 和 Swift 4。
我有一个用 Swift 3 和 Xcode 8 编写的项目。
我试图在 Xcode 9 中运行这段代码。在 Xcode 将 Swift 3 转换为 Swift 4 之后,我遇到了以下错误:
Type of expression is ambiguous without more context
Here is the link from where I was using the Swift file.
错误在下面的方法中:
private func handleBase64(message: String) {
// binary in base64 string
let noPrefix = message[message.index(message.startIndex, offsetBy: 2)..<message.endIndex]
if let data = NSData(base64Encoded: noPrefix, options: .ignoreUnknownCharacters) {
client?.parseEngineBinaryData(data as Data)
}
}
最佳答案
您不应将库的函数手动更新到 Swift 4。
关于ios - 没有更多上下文,表达式类型不明确。 <套接字引擎> 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46587840/