I have a XML file in resources folder in xcode and I want to parse the XML.. The question is how to get access to the file programmatica开发者_如何学编程lly? Thanks in advance.
NSXMLParser is an event driven xml parser. You can use it but I tend to like query based parsers better. Lib2Xml.
this will get you started with lib2xml
http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html
An xml file is the just another text file. This has info on different ways to load xml files.
How to save/load text files in Objective-C for the iPhone, using UITextView?
There are many options. Two of the most popular: use Cocoa's NSXMLParser class, or use TouchXML. If you use NSXMLParser, you'll end up creating a delegate for the parser that decides what to do whenever the parser encounters XML tags, data, etc.
精彩评论