I had a function XMLParser working but I'm trying to expand the class to handle different XML files my app needs.
I'm getting the error "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[XMLParser initXMLParserForValidation]: unrecognized selector sent to instance 0x7564ea0'" Here's the code there.
- (void)validateEmail:(NSString *)urlString {
NSURL *url = [NSURL URLWithString:urlString];
NSData *data = [[NSData alloc] initWithContentsOfURL:url];
NSXMLParser *nsXmlParser = [[NSXMLParser alloc] initWithData:data];
XMLParser *parser = [[XMLParser alloc] initXMLParserForValidation];
[nsXmlParser setDelegate:parser];
BOOL wasSuccessful = [nsXmlParser parse];
if (wasSuccessful) {
self.result = [parser result];
}
}
I've put breakpoints and stuff and but doesn't even get into my initXMLParserForValidation class. Here it is anyway, though.
- (XMLParser *) initXMLParserForValidatation {
self = [super init];
_result = [[ValidationResult alloc] init];
return self;
}
I've tried to mimic the code that's working but I can't see any differences. Driving me nuts. I'm new at this iphone stuff, though. Help much appreciated.