Get nested data from local JSON file
- by Lbase
Now that I have the NSDictionary object JSONDictionary, how do I get the nested data inside of it?
NSString *JSONFilePath = [[NSBundle mainBundle] pathForResource:@"sAPI" ofType:@"json"];
NSData *JSONData = [NSData dataWithContentsOfFile:JSONFilePath];
NSDictionary *JSONDictionary = [NSJSONSerialization JSONObjectWithData:JSONData options:kNilOptions error:nil];
NSLog(@"Dictionary: %@", JSONDictionary);
sAPI.json snippet:
{
"ss": [{
"name": "bl",
},
"ls": [{
"name": "ML",
"abbreviation": "ml",
"id": 10,