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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -