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.
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 handled. NSXMLParser can handle these, too. The NSXMLParserDelegate protocol includes many more methods ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access