tags:

views:

53

answers:

4

hi i am new to iphone. what i did is displaying grid of 10 images.For this i take a array and add all images to array.For this i am write the code as

[_image addImage:[UIImage ImageNamed:@"black.jpg"]];

like this i add all images to array.Now what i need is i need to get all the images through Xml file and add to the images array. How can i done this.Please post any link or code. Thanks in advance.

A: 

The class you need is NSXMLParser and the delegate NSXMLParserDelegate.

Felix
pls post some code or link
MaheshBabu
A: 

Have a look here or even here at SO. What you are looking for is to parse an XML document, and you can do it with the NSXMLParser class, libxml2, or other libs/tools mainly based on those two. Also you'd better have a look at this project by Apple it will show you the main differences in terms of performance between technologies

rano
Thanks for the link to the Apple project, didn't know about it!
Stelian Iancu
@Stelian Iancu it is probably the best first place to start when you have doubts on whether using libxml2 or NSXMLParser (plus it show pretty clearly how to use both)
rano
A: 

First of all you need to parse your xml file. You can use the NSXMLParser class. How exactly you would do this, depends on the structure of your xml file. There are a lot of tutorials on the Internet about how to use it, for example see here or here.

Stelian Iancu
+1  A: 

Hi Mahesh,

Please checkout below link. It will give you an idea and even will solve the problem or parsing

http://www.iphonesdkarticles.com/2008/11/parsing-xml-files.html

Hope this helps you..

hAPPY cODING...

Suriya
Its the best example of Parsing.. And below you wil find the link to download the source code also... so use it n save time ;)
Suriya