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?