So I've got an NSDictionary that holds JSON data from doing the following:
NSDictionary* dictionary = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&someError];
And when I NSLog my dictionary, I get the output below.
2015-06-11 17:13:49.699 AmigoDash[57994:1195566] (
{
"_id" = {
"$id" = 5579fde2e4b0588ab009f841;
};
hours = "10-11";
image = imageURL;
name = "Boleskine Bistro";
},
{
"_id" = {
"$id" = 5579fe1fe4b0588ab009f84a;
};
hours = "9-11";
image = imageURL;
name = Amrikos;
}
)
The problem I'm facing now is trying to iterate through the dictionary. When I try to do it, the code crashes. I'm new to working with JSON and iOS in general. Kind of overwhelmed. I ultimately need to get the name and image information from each unique object in the dictionary, so I have to iterate through the dictionary.
From your log,your json is an array
I think using keyPath,it is easy
If you still want to loop