O'Reilly logo

iOS and OS X Network Programming Cookbook by Jon Hoffman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Parsing an RSS feed with NSXMLParser, NSURL, and NSData

While this recipe shows you how to parse an RSS feed using NSXMLParser, NSURL, and NSData, it is very easy to convert this code to parse any XML feed. All you need to do is change the tags that you are looking for.

In the previous recipes, we used NSURLConnection to access web services. For this recipe, we will be using the dataWithContentsFromURL: method of the NSData class to access a web service. We will assume that the response is an XML data feed and will use the NSXmlParser to parse the XML feed.

This recipe will load and parse the XML content synchronously. You will want to display an activity indicator to let the user know that the application did not freeze while the URL was loading. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required