iphone - can't figure out unrecognized selector sent to instance for XMLparser -
i had function xmlparser working i'm trying expand class handle different xml files app needs.
i'm getting error "terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[xmlparser initxmlparserforvalidation]: unrecognized selector sent instance 0x7564ea0'" here's 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 , stuff , doesn't initxmlparserforvalidation class. here anyway, though.
- (xmlparser *) initxmlparserforvalidatation { self = [super init]; _result = [[validationresult alloc] init]; return self; }
i've tried mimic code that's working can't see differences. driving me nuts. i'm new @ iphone stuff, though. appreciated.
there's spelling error in declaration of class' init method:
initxmlparserforvalida*ta*tion
then you're calling init method this, proper spelling, doesn't exist:
initxmlparserforvalidation
remove ta
, should go!
Comments
Post a Comment