Hi I have a json string converted unsing the JSON framework into a dictionary and I need to extract its content. How could I iterate to the nested dictionaries? I have alrea
I'm sure you have solved this at this point, but I found it convenient to write a recursive utility class function that recursively logs every key of a dictionary:
/**
* Recursively logs the keys and values of each object in the dictionary,
* along with the class of the value.
*
* @param dict The dictionary to inspect
*/
+ (void)logDictionaryKeys:(NSDictionary*)dict {
for (id key in dict) {
if ([dict[key] isKindOfClass:[NSDictionary class]]) {
[self logDictionaryKeys:dict[key]];
}else {
NSLog(@"Key: %@", key);
NSLog(@"Value: %@ (%@)", dict[key], [dict[key] class]);
}
}
return;
}