objective-ccocoansxmlparser

Why will my NSObject not work as a NSXMLParserDelegate?


I'm trying to use an NSXMLParser to parse a property file that is related to my main document type. Originally I tried creating a method in my document that should have created an NSXMLParser then set itself as the delegate. As so:

NSXMLParser *infoParser = [NSXMLParser alloc] init];

[infoParser setDelegate:self];

This just brings up a warning that I'm passing an incompatible id. I've looked through the documentation and added all of the optional methods for NSXMLParserDelegates along with now moving this implementation to an NSObject. But still incompatible id. Is there something I should be doing extra? Beyond including methods mentioned here, what do i need to do to conform to this protocol?


Solution

  • Add < NSXMLParserDelegate > in @interface YourObject : NSObject line in your .h file and the error should dosappear