Alamofire Swift 2.0 json响应
我不断地发现这个错误:Alamofire Swift 2.0 json响应,swift,swift2,alamofire,Swift,Swift2,Alamofire,我不断地发现这个错误: '(_, _, _, _) -> Void' is not convertible to 'Response<AnyObject, NSError> -> Void' 经过几次试验,我成功了 Alamofire.request(.GET,"http://example.com/test.php", parameters: ["username": usernamep]) .responseJSON { response
'(_, _, _, _) -> Void' is not convertible to 'Response<AnyObject, NSError> -> Void'
经过几次试验,我成功了
Alamofire.request(.GET,"http://example.com/test.php", parameters: ["username": usernamep])
.responseJSON { response in
if let json = response.result.value {
var jsonObj = JSON(json!)
if let data = jsonObj["flist"].arrayValue as [JSON]?{
datasMentions = data
....
}
}
}
你不应该有
(u,u,u,u)
,它们应该是(respond,json,error,u)
,这些是响应。
Alamofire.request(.GET,"http://example.com/test.php", parameters: ["username": usernamep])
.responseJSON { response in
if let json = response.result.value {
var jsonObj = JSON(json!)
if let data = jsonObj["flist"].arrayValue as [JSON]?{
datasMentions = data
....
}
}
}