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
Post a Comment