ios - Suddenly giving error when Converting foundation object in json data -


my code working fine before , giving error like

cannot convert value of type nsdata type data in coercion.

can explain why happing?

do {    if let postdata: nsdata = try jsonserialization.data(withjsonobject: parameter, options: jsonserialization.writingoptions.prettyprinted) nsdata? {         let json = nsstring(data: postdata data, encoding: string.encoding.utf8.rawvalue)! nsstring         print("parameters --->>> \(json)")    } } catch {    print(error) } 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -