Dostávam túto chybu:
nemôže konvertovať hodnotu typu nsdictionary na očakávaný typ reťazca argumentov
let json:NSDictionary = try JSONSerialization.jsonObject(with: dataResponse, options: []) as! NSDictionary
self.performSelector(onMainThread: Selector(updateUIwithJsonResponse), with: json, waitUntilDone: true)
performSelector
volá táto funkcia:
func updateUIwithJsonResponse(json:NSDictionary) {
print(json)
}
Každý z vás vie, prečo som túto chybu dostal?
odpovede:
1 pre odpoveď č. 1Vaša metóda má parameter, skúste to
self.performSelector(onMainThread: #selector(updateUIwithJsonResponse(json:)), with: json, waitUntilDone: true)