I have written some code, most of which has been taken from tutorials etc, but not sure it\'s 100%. The code works, but I think its a bit long winded, and has memory leaks.<
Unfortunately the NSXMLParser that Apple provides requires at least 3 functions to work, as you have done. If you want to clean it up, think about using a third party script, such as TouchXML or KissXML.
As for making this dynamic, you can put those numbers into an array and read them out, or change the way you're setting the data. Usually with different sections you use different arrays for the data. This takes your theRow variable out of the equation. Here is a tutorial that uses multiple arrays without a dictionary.
@JeremyP has some good suggestions. If you're still struggling, do a Build and Analyze. This will show you "potentially leaked objects" so you can go through and make sure everything's released properly.
There are 2 ways to go about parsing XML Trees-which is what you are doing.
The first is using the NSXML parser you already have. First create a dictionary containing all of the higher level element names, i.e. section and item, then add two extra strings to your parser, currentNodeName and parentNodeName. As you iterate through, change the currentNodeContent to the elementName. If the elementName is in your dictionary, set parentNodeName to the elementName, otherwise leave it as is.
Using TouchXML requires a bit less code. It works with xpaths, so you can specify /section/name/item/title in a path format. You will probably need to add another for loop that counts because you drill down another level.