ios - Serialize JSON string SBJSON vs NSJSONSerialization vs anything else? -
i receiving json string , want know how serialize dictionary can parse managed object.
i have looked @ few ways (named in title), , can't seem find simplest, quickest alternative. use nsjsonserialization, i'm not sure made this?
code string comes in
nsstring *data = [[nsstring alloc]initwithdata:response encoding:nsutf8stringencoding]; nslog(@"string %@",data);
nslog message
string [{"0":"1","id":"1","1":"re ee","name":"re ee","2":"http:\/\/ree.com\/images\/re.png","backgroundimageurl":"http:\/\/ree.com\/images\/re.png","3":"http:\/\/ree.com\/images\/re.png","logoimageurl":"http:\/\/ree.com\/images\/re.png"}]<br />
thank in advance
jsonkit looking for.
besides ease of use, it's quicker sbjson, quicker nsjsonserialization.
for example, can array this:
nsarray* arrayfromjson = [data objectfromjsonstring]; nsstring* id = arrayfromjson[0][@"id"];
easy, huh?
Comments
Post a Comment