|
Reading Structures Produced by RSS ImporterI'm trying to read the titles of an RSS feed, through the structure that RSS Importer creates. Here's my code: for (i=0; i < maxArticles; i++) { key = [NSString stringWithFormat:@"%i", i]; thisDictionary = [dictionary objectForKey:key]; thisResult = [NSString stringWithFormat:@"%@", [thisDictionary objectForKey:@"title"]]; NSLog(@"thisResult: %@", thisResult); } it seems pretty simple, but when I run it, it says all my titles are null. I can't seem to read the structure's within the structures. Here's my log: 2011-04-12 17:04:55.918 Quartz Composer[32569:a0f] thisResult: (null) 2011-04-12 17:04:55.918 Quartz Composer[32569:a0f] thisResult: (null) 2011-04-12 17:04:55.918 Quartz Composer[32569:a0f] thisResult: (null) Is this output structure not a NSDictionary of NSDictionaries? Am I overlooking something super obvious? Thanks!
|
Problems identified!
The output is not a NSDictionary of NSDictionaries. It's a NSArray of NSDictionaries.
The bug that @cwright pointed me to on another thread (http://kineme.net/forum/Discussion/Programming/NSDictionaryturnsintoNSCF...) strips they keys off of dictionaries embedded in arrays.