failure里的operation報(bào)錯(cuò)
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)?'
2016-01-07
你改成她提示的那樣試試看 改成這個(gè)((AFHTTPRequestOperation?, NSError) -> Void)?