我开始使用ios并将我的项目转换为Swift 3后我收到此错误消息
无法转换类型'(AnyObject!,Int)的值 - >虚空'预期参数类型' SRWebClient.SuccessHandler?'
我无法弄清楚出了什么问题,我该如何解决这个问题?
if(image != nil) {
let imageData: Data = UIImagePNGRepresentation(image!)!
SRWebClient.POST(url)
.data (imageData, fieldName:fieldName, data: d)
.send({(response:AnyObject!, status:Int) -> Void in // Error message here
//process success response
(self.delegate?.ApiCallCompleted!(response as! NSDictionary, error: nil))!;
},failure:{(error:NSError!) -> Void in
//process failure response
self.delegate?.ApiCallCompleted!(["":""], error: error);
})
}
提前致谢!
答案 0 :(得分:1)
SuccessHandler
表达式语法为public typealias SuccessHandler = (Any?, Int) -> Void
将此表达式(response:AnyObject!, status:Int) -> Void in
更改为(response: Any, status:Int) -> Void in
了解更多支票SRWebClient