Reading XML data files

Finally, we have everyone's favorite data format: basic unadulterated XML. For this recipe, we will use Google's GDataXML library to read and parse a simple XML document. In the following scene, we see rocky terrain with some boulders and weeds:

Reading XML data files

Getting ready

Please refer to the project RecipeCollection01 for full working code of this recipe.

How to do it...

The first thing we need to do is integrate Google's GData XML tools:

  1. Download and unzip the gdata-objectivec-client from here: http://code.google.com/p/gdata-objectivec-client/downloads/list
  2. In the folder Source\XMLSupport find the files GDataXMLNode.h and GDataXMLNode.m and ...

Get Cocos2d for iPhone 1 Game Development Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.