Basically I have an XML response that is returned and a string, and i need to loops through the xml and store all the information in an array. here is the xml
Use Apple's NSXMLParser
; it made be old-school and all but it's really efficient.
Setup your XMLParser accordingly (use the NSXMLParserDelegate
protocol).
Once your parser hits call the parser:didStartElement:namespaceURI:qualifiedName:attributes:
delegate call back and the elementName
is equal to Record
(from what you seem to want).
Alloc' init' an NSMutableDictionary
. Then like above if elementName
is equal to Destination
then [myDictionary setObject: elementName forKey: @"Destination"]
and et cætera.
Hope that helped :).
Little side note: prefer using Apple's
"technology" instead of 3rd parties: it's more efficient and the possibilities are endless.