For the More Curious: NSXMLParser

NSXMLParser is the built-in XML parser in the iOS SDK. While there are plenty of parsers you can pick up on the Internet, adding a third party dependency is sometimes difficult. Many developers, seeing that NSXMLParser is not a tree-based parser (it doesn’t create an object graph out of the box), go searching for an alternative parser. However, in this chapter, you’ve learned how to make NSXMLParser into a tree-based parser.

Other than tree-based parsing, some developers may be concerned about parsing more complicated XML. To parse simple XML, all you need are the three delegate methods used in this chapter. More complex XML has element attributes, namespaces, CDATA, and a slew of other items that need to be ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.