O'Reilly logo

Cocos2d for iPhone 1 Game Development Cookbook by Nathan Burba

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

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 ...

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