Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML with Cocoa Touch

I am a new learner at the area of Objective-C. I would like to retrieve data from XML page on the iPhone. Is it possible? It would be more helpful to me if I get an appropriate suggestion or code.

like image 677
ashish Avatar asked Nov 25 '25 06:11

ashish


2 Answers

The SDK comes with the NSXMLParser class. Some people prefer to use the libxml2 library as it can be faster and more memory efficient than NSXMLDocument but you may want to wrap it with an Objective C layer as it is a C API. See this example.

like image 153
AnthonyLambert Avatar answered Nov 27 '25 00:11

AnthonyLambert


There was a good episode of cocoaFusion: the other day that covered the ins and outs of XML parsing. Head on over to cocoafusion.net and look for Episode 2: An intro to using web APIs and XML.

The show notes section for that episode has some sample code downloads and links to other sites that contain more information (including some of the links mentioned in the other answers here).

Cheers!

like image 33
Michael Fey Avatar answered Nov 26 '25 23:11

Michael Fey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!