objective c - Convert JSON object to serialized JSON string -


probaly duplicate can't seem find solution. there way in objective-c convert:

{     "a" : "value1",     "b" : 1,     "c" : "value3",     "d" : "value4", } 

to:

"{\r\n\t\"a\" : \"value1\",\r\n\t\"b\" : 1,\r\n\t\"c\" : \"value3\",\r\n\t\"d\" : \"value4\",\r\n}" 

thank you

i used following code convert json object nsstring in json format.

nsdata *jsondata = [nsjsonserialization datawithjsonobject:yourdictionary options:kniloptions error:nil]; nsstring *strjson = [[nsstring alloc] initwithdata:jsondata encoding:nsutf8stringencoding]; 

hope helps you.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -