If you mean NSXMLParser
, that is a SAX-style parser, which means you travel the XML tree unidirectionally from beginning to end of file. Every time the parser encounters something significant, it calls one of its delegate methods. In these methods, you read the values and fill your array by adding values one at a time.
It appears awkward at first and the code can become pretty verbose, with lots of conditionals. But SAX parsing is fast and has a small memory footprint.
I strongly recommend studying the examples in Apple's documentation on Event-Driven XML Programming, starting here.