-
Book Overview & Buying
-
Table Of Contents
Cocos2d for iPhone 1 Game Development Cookbook
By :
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:

Please refer to the project RecipeCollection01 for full working code of this recipe.
The first thing we need to do is integrate Google's GData XML tools:
Download and unzip the gdata-objectivec-client from here: http://code.google.com/p/gdata-objectivec-client/downloads/list
In the folder Source\XMLSupport find the files GDataXMLNode.h and GDataXMLNode.m and add them to your project.
In your Project Navigator click on your Project.
To the right of this, click on your Target.
Go to the Build Settings tab.
Find the Search Paths\Header Search Paths setting.

Add /usr/include/libxml2 to the list.

Find the Linking\Other Linker Flags section.

Add -lxml2 to the list.

Import GDataXMLNode.h into your code. If it compiles...
Change the font size
Change margin width
Change background colour