views:

1039

answers:

2

hello, i am a learner at the area of objective c. i am trying to build an iphone app. and here i have used cocos2d. now i would like to use UITableView for showing data from XML file. Now it is my question that , is it possible to use UITableView with cocos2d and is it also possible to retrive data from XML file.

A: 

Absolutely! The XML file doesn't even have to be local in your app.

I recommend parsing the XML with something like TouchXML. The only built in iPhone XML parsing library is a event based one that is hard to use unless you have the right sort of structure in you data.

Then in the table view methods that fill your table with data, select items from the variables that you have parsed out of the data file.

Squeegy
A: 

Yes, Squeegy is right. I do want to correct a conceptual misunderstanding you appear to have, though. Any iPhone application you write will always be based on the core iPhone APIs. Thus, your using Cocos2d is irrelevant to your use of UITableView. As for XML parsing, that is, of course, not done by Cocos2d. Cocos2d is a high-level abstraction of OpenGL for relatively easy game development; XML parsing is not in its purview. Thus, again, your use of Cocos2d is irrelevant to your use of an XML parsing library.

Jonathan Sterling