I am trying to parse this json:
{
"myData": [
{
"date": "2013-07-29",
"preferredMeetingLocation": "home",
"isbn": null,
"category": "Clothing",
"price": "5",
"title": "clothingstuff",
"description": "Desc"
},
{
"date": "2013-07-29",
"preferredMeetingLocation": "home2",
"isbn": null,
"category": "Clothing",
"price": "2",
"title": "other",
"description": "Desc2"
}
]
}
So far I have:
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:nil];
NSDictionary *results = [json objectForKey:@"myData"];
for (NSDictionary *item in results) {
NSLog(@"results::%@", [results objectForKey:@"title"]);
}
but I get Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFArray objectForKey:]: unrecognized selector sent to instance 0x8877e40'
The main goal is to be able to parse the data received and then display each set of info in a cell.
What am I doing wrong?