Here’s what I’m trying to do. I’m having the user input a city, which I’m then plugging into Yahoo’s Placefinder. Here’s an XML file with “Springfield” entered as a test city.
http://where.yahooapis.com/geocode?city=springfield
As you can see, Yahoo nicely provides a number of how many cities it found. So, next I wanted to take each city found, take line2, line4, and woeid and store them in an array. So, the array would look like this (with two cities for example)…
-> line1
City1 -> line2
-> woeid
-> line1
City2 -> line2
-> woeid
Then, I wanted to take this array and display it in a UITableView, with the WOEID hidden. When one of the cities is selected, I need to take the selected city’s WOEID and use it.
I was thinking of using an instance of NSXMLParser to do this.
EDIT: Perhaps this question is too broad. Maybe if I could just get some help with parsing the XML and adding to an array. Thanks!
I’d recommend to use a DOM parser instead
NSXMLParser(SAX based parser), because that makes it much easier to construct the array.You could use libxml2 (included in iPhone SDK), TouchXML, TinyXML or TBXML.