How to read XML file and display it in UITableView?
I need to display an XML file in a UITableView
. Also, if I click on one of 开发者_开发问答the tableRow
, it should open in new view.
That's two fairly big tasks for a two-sentence question. One approach to reading an XML file would be to use NSXMLParser. Apple has a good document describing how to use it. Start with that and post more questions here if you get stuck. You'll usually find that more specific questions get more specific answers.
Oh. I just noticed the question is six months old. I guess that proves my point.
Please try the following steps and ask more specific questions if you get stuck:
- Download the Data using NSURLConnection
- Use NSXMLParser to parse the data and store it in a collection (NSArray is probably what you want).
- Use UITableView's Delegate and datasource methods to create cells and respond to cell selections.
精彩评论