iphone - How to generate a JSON string compatible with Objective-C syntax -
i need kind of json string generator objective-c. thought there must not find anything.to specific, example have json string like:
{"name":"abc","email":"def@ghi.com","password":"1"}
when want store in objective c, have write like:
@"{\"name\":""\"abc\""",\"email\":""\"def@ghi.com\""",\"password\":""\"1\"""}"
so confusing , hard implement. there generators or easy way implement it. thanks
convert json string dictionary...
nsdata* data = [yourjsonstring datausingencoding:nsutf8stringencoding]; nsdictionary* jsondict = [nsjsonserialization jsonobjectwithdata:data options:kniloptions error:&error]; nslog(@"jsondict:%@",jsondict);
Comments
Post a Comment