iphone - JSON parsing issues -
i getting json can't seem parse it. code:
[httpclient postpath:@"" parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { nsdictionary *jsondict = [nsjsonserialization jsonobjectwithdata:responseobject options:kniloptions error:nil]; nslog(@"%@",jsondict); nsarray *jsonarray = [jsondict objectforkey:@"sjson"]; nslog(@"%@",[jsonarray class]); nslog(@"%@",jsonarray);
the nslog prints class gives me _nscfstring class.
could it not json? although looks json. looks this:
[{"imagetagid":78,"xpixel":408,"ypixel":69,"xpercent":17}]
looks have json embedded in json:
{ "sjson": "[{\"imagetagid\":78,\"xpixel\":408,\"ypixel\":69,\"xpercent\":17}]" }
you'll have decode "jsonarray" (which string) again using nsjsonserialization then.
Comments
Post a Comment