Wednesday, 15 January 2014

How to parse JSON value in iPad? -



How to parse JSON value in iPad? -

using sbjson parser parse json value server, have received response like

-(void)connectiondidfinishloading:(nsurlconnection *)connection { nsstring *json_string = [[nsstring alloc] initwithdata:data encoding:nsutf8stringencoding];

json_string value here:

{ "status": true, "result": { "nid": "1116", "title": "peoplesoft enterprise hcm 91 release notes.pdf", "status": "1", "uid": "1", "body": "\x3cp\x3e\x3ca href=\"http://www.carinsuranceiseasy.com/\"\x3echeapest auto insurance\x3c/a\x3e wttig \x3ca href=\"http://www.lifeinsuranceshopping.net/\"\x3elife insurance quotes\x3c/a\x3e 304 \x3ca href=\"http://www.bestautoinsurancepolicies.net/\"\x3eaffordable auto insurance\x3c/a\x3e 39292\x3c/p\x3e", "splitpdfs": [ ], "mail": "gumpagain@gmail.com", "name": "admin", "pdf": "http://www.publishgenie.com/sites/default/files/pdf_convert/2012/12/19/1355908128-986.pdf", "page_number": "249", "filesize": 8936895, "referrallink": "http://www.publishgenie.com/index.php?q=ebook-referral/530/1116/19f80281e0ad314423afb51a5322e2ac" } }

then tried set value in nsdictionary dictionar value null, how parse this? please help me.

thanks in advance

i tried this:

sbjson * parser = [[sbjson alloc] init]; nsdictionary *dic = (nsdictionary *)[parser objectwithstring:json_string error:nil];

is there reason using sbjson? can utilize build in parser:

id jsonobject = [nsjsonserialization jsonobjectwithdata:data options:kniloptions error:&error];

edit: json string invalid. you can utilize site check json

json ipad parsing nsdictionary

No comments:

Post a Comment