How can I consume this JSon data in iOS 5
({assets = ( { identity = 34DL3611;}, {identity = 34GF0512;}, {identity = 34HH1734;}, {identity = 34HH1736;}, {identity = 34YCJ15;} );
identity = DEMO;})
getting this data on console through this call
id list =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
NSLog(@"VLIST: %@", list);
Now I have got the data in exact JSON format after using encoding:NSUTF8StringEncoding, I want to use native jsonserializer of iOS 5
NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
the JSON data is:
[{"assets":[{"identity":"34DL3611"},{"identity":"34GF0512"},{"identity":"34HH1734"},{"identity":"34HH1736"},{"identity":"34YCJ15"}],"identity":"DEMO"}]
Now how can I get this data, so that I would get assets array values and populate them in table and get the value of identity(which is DEMO) to use it as a header.
thanx
It seems that you are able to successfully parse the JSON data and now would like to know how you can access the data. The parsed JSON data is either a
NSDictionaryor aNSArrayinstance containingNSDictionary,NSArray,NSString,NSNumberetc. instances.From your sample data, it looks as if your data is heavily nested. (The purpose isn’t quite clear.) It’s an array containing a dictionary containing an array containing a dictionary.
You could access it like this: