【发布时间】:2015-11-26 00:02:05
【问题描述】:
我在使用 Alamofire 编译我在 Swift 1 中创建的应用程序时遇到问题。问题出现在以下代码中:
func fetchApiData() {
print("called")
// I believe this is the problem code below.
let _requestURL1 = Alamofire.request(.GET,dataSourceURL!)
_requestURL1.responseJSON { (_requestUrl, _requestResponse, _objJSON1, error) -> Void in
if(_objJSON1 != nil)
{
let jsonResult1 = _objJSON1 as NSDictionary;
//let jsonResult2: NSDictionary! = NSJSONSerialization.JSONObjectWithData(data,
// options:NSJSONReadingOptions.MutableContainers, error: self.error) as NSDictionary
self.checkIP(jsonResult1)
self.checkGeo(jsonResult1)
//println(jsonResult1);
}
else{
return
}
}
给出的错误说:
Contextual type for closure argument list expects 1 argument, but 4 were specified
我已经尝试了here 的解决方案,但我无法让它在没有错误的情况下正常工作。请帮忙!
【问题讨论】: