XML Tutorial for iOS: How To Read and Write XML Documents with GDataXML

A XML tutorial for iOS on how to easily read and write XML documents with Google’s open source XML processing library: GDataXML. By Ray Wenderlich.

Leave a rating/review
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

And That’s A Wrap!

Here is a sample project with all of the code that we’ve developed in the XML tutorial so far. Note that the app doesn’t show anything in the GUI as that isn’t important for this XML tutorial – it just shows a few output lines in the console.

By the way – before you use XML in your projects, you should take a second to consider why you want to use XML in the first place and if that is the best choice. In this example, if all we were using XML for was loading and saving characters for this particular app, XML would probably be overkill, and it would be better to use another serialization format such as property lists, NSCoding, or even Core Data.

However, XML really starts to shine when you start having multiple applications use the same data. If we had a Mac application that generated a list of characters and we wanted our iPhone app to be able to read and modify that list, that’s when it becomes to be particularly useful. This is because XML is a standard format for exchanging data that is quite easy to work with, as you’ve seen.

So any plans to use XML reading and writing in your apps? What are you using it for?