We will first discuss how to simply load an XML file. We will later consider how to add data back into an XML file.
For this chapter, I created a new project called
Data, and all the necessary files can be found in the
Resources folder of this chapter. The project file is also included in the code resource for the chapter, so if you get stuck anywhere, you can refer to it for clarification.
To load an XML file, we first need to have an XML file to work with. For this, I included the
GroupList.xml file. Import this file into the project.
The file can be viewed in Xcode. Click on the file to see it in the navigator, as follows:
<Group> <Player> <Name>Siddharth</Name> <Level>1</Level> </Player> <Player> <Name>Alice</Name> ...