【发布时间】:2016-09-15 10:32:05
【问题描述】:
我在 Xcode 7.3 中有 swift 2.2 版本的工作项目。现在我已经更新了 Xcode 8 并迁移到了 swift 3。现在我的项目包含错误,特别是对于像 afnetworking 的成功块这样的块。
这给出了错误
Cannot convert value of type '() -> ()' to expected argument type '((URLSessionDataTask, Any?) -> Void)?'
我不明白如何解决这个问题以按照 swift 3 工作。
Facebook 登录也有类似的错误。
这给出了错误
Cannot convert value of type '(FBSDKLoginManagerLoginResult!, NSError!) -> Void' to expected argument type 'FBSDKLoginManagerRequestTokenHandler!'
和
Cannot convert value of type '(_, _, NSError!) -> Void' to expected argument type 'FBSDKGraphRequestHandler!'
所有错误都与 swift 3 中的处理程序块有关。我不理解错误,因此无法解决。任何帮助将不胜感激。提前致谢。
【问题讨论】:
标签: ios facebook afnetworking swift3 xcode8