views:

42

answers:

3

Like the title says, I want to parse XML in my iPhone application, but there is no NSXMLParserDelegate protocol like there is in the System Foundation framework.

Can I just add a reference to the /System/Library/Frameworks/Foundation.framework in my iPhone application?

A: 

Actually its ok, instead of implementing the NSXMLParserDelegate you can just not implement it and define the require methods, like:

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName  attributes:(NSDictionary *)attributeDict {
}

and it magically works :)

Mark
+2  A: 

The NSXMLParser documentation shows the delegate methods available to you

nduplessis
A: 

Also, a good library for parsing XML is TouchXml. I use it for parsing XML and its pretty easy to work with.

Wim Haanstra
thanks for the link
Mark