在使用 Swift 1 时,这段代码运行良好:
let connectionSession = NSURLSession.sharedSession()
let task = connectionSession.dataTaskWithURL(currentURL!, completionHandler: { (data, response , error) in
...
在 Swift 2 中,我收到以下编译器错误:
从 '(_, _, _) throws -> _' 类型的抛出函数到非抛出函数类型 '(NSData?, NSURLResponse?, NSError?) -> Void' 的无效转换
我怎样才能解决这个问题?