Reputation: 9120
I'm getting this error:
cannot convert value of type nsdictionary to expected argument type string
let json:NSDictionary = try JSONSerialization.jsonObject(with: dataResponse, options: []) as! NSDictionary
self.performSelector(onMainThread: Selector(updateUIwithJsonResponse), with: json, waitUntilDone: true)
performSelector
is calling this function:
func updateUIwithJsonResponse(json:NSDictionary) {
print(json)
}
Any of you knows why I'm getting this error?
Upvotes: 0
Views: 1959
Reputation: 7187
Your method takes a parameter, so try
self.performSelector(onMainThread: #selector(updateUIwithJsonResponse(json:)), with: json, waitUntilDone: true)
Upvotes: 1