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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -