ios - 没有更多上下文,表达式类型不明确。 <套接字引擎> 类

标签 ios xcode swift3 swift4

我正在使用 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。

再次下载库,it has now been updated to Swift 4 .

关于ios - 没有更多上下文,表达式类型不明确。 <套接字引擎> 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46587840/

相关文章:

ios - 如果 registerForRemoteNotificationTypes : is not supported in iOS 8. 0 及更高版本,则为 iOS 构建

iphone - 如何将 UIImageView 实例声明为全局实例?

iphone - 为 ios 视网膜应用程序添加图像两次?

ios - 如何添加标签部分文本背景的图像?

ios - 如何在 tabbarcontroller 中旋转一个 View ?

objective-c - 滑动 Custome UITableViewCell/Custom UITableViewController 时内存泄漏

iphone - Google Drive SDK- iOS 应用程序中的音频和视频流

ios - popToViewController 后 pushViewController 上的应用程序崩溃

swift - 扩展协议(protocol)以提供对 "Comparable"协议(protocol)的默认合规性

ios - 回调 block 中的多个返回值