concept NSXMLParser in category ios

appears as: NSXMLParser
iPhone in Action: Introduction to Web and SDK Development

This is an excerpt from Manning's book iPhone in Action: Introduction to Web and SDK Development.

Because of XML’s popularity on the internet, the iPhone SDK includes its own XML parser, the NSXMLParser class. This is an event-driven API, which means that it will report start and end tags as it moves through the document, and you must take appropriate action as it does.

20.5.1. Starting up NSXMLParser

In order to get started with the NSXMLParser, you need to create it, set various properties, and then start it running. The most important methods for doing so are listed in table 20.7.

Table 20.7. Methods to get your NSXMLParser going

Method

Summary

initWithContentsOfURL:

Creates a parser from an NSURL

initWithData:

Creates a parser from an NSData

setDelegate:

Defines a delegate for the parser

parse

Starts the parser going