黑山白水
2015-12-04 00:13
let manager = AFHTTPRequestOperationManager()
let url = "http://api.openweathermap.org/data/2.5/weather"
let params = ["lat": latitude, "long": longitude, "cnt": 0]
manager.GET(url,
parameters: params,
success: { (operation:AFHTTPRequestOperation!,
responseObject: AnyObject!) in
print("JSON: " + responseObject.description!)
},
failure: { (operation:AFHTTPRequestOperation!,
error: NSError!) in
print("Error: " + error.localizedDescription)
})
failure里提示/Users/enchanterzero/Desktop/1/Weather/Weather/ViewController.swift:52:22: Cannot convert value of type '(AFHTTPRequestOperation!, NSError!) -> _' to expected argument type '((AFHTTPRequestOperation?, NSError) -> Void)?'
你改成她提示的那样试试看 改成这个((AFHTTPRequestOperation?, NSError) -> Void)?
Swift Weather APP
35555 学习 · 241 问题