I have an atomfeed with which is succesfully getting parsed. All the articles are in the root array.
But now I also have categories as a tag in the feed.
How can I parse the atom xml so that the root array contains the categories and each category filters to an array with the corresponding articles.
Thanks,
Bing
If I understand you correctly, you have an
NSArray(you didn’t say of what, so I’ll assumeNSDictionary) of Atom feed items, each of which has a category. What you want is a structure that groups the items by category intoNSArrays.The appropriate data structure, in my opinion, is an
NSDictionarythat maps categories onto arrays of items. Here’s how I would do it: