gdjy098
2015-12-02 20:39
函数的manager.GET报错 manager.GET 报错,Cannot invoke 'GET' with an argument list of type '(String, parameters: NSDictionary, success: (AFHTTPRequestOperation!, AnyObject!) -> _, failure: (AFHTTPRequestOperation!, NSError!) -> _)' 具体应该怎么改?谢谢!
上面的代码运行结果如下:
manager.get(url,
parameters: params,
success: { (operation: AFHTTPRequestOperation,
responseObject: Any) in
var info = responseObject as? NSDictionary
print(info);
print("OK")
},
在failure: { (operation: AFHTTPRequestOperation!,
error: NSError!) in
println("Error: " + error.localizedDescription)
})这里
改为
failure: { (operation: AFHTTPRequestOperation?,
error: NSError) in
println("Error: " + error.localizedDescription)
})
请问解决了吗
我也遇到这个问题了
manager.GET(url,
parameters: params,
success: { (operation: AFHTTPRequestOperation!,
responseObject: AnyObject!) in
println("JSON: " + responseObject.description!)
},
failure: { (operation: AFHTTPRequestOperation!,
error: NSError!) in
println("Error: " + error.localizedDescription)
})
出问题的就是这段代码,谢谢
Swift Weather APP
35555 学习 · 241 问题