i dont know if i'm a great programmer, but i'm a pretty good imitator. so after trying to get to the root of my problem, my class is now almost exactly as the XMLReader in the SeismicXML sample code:
and the runtime log is:
my class inherits directly from NSObject. it implements:
parserDidStartDocument:
parser: didStartElement: ...
parser: didEndElement: ...
parser: foundCharacters:
at one point i checked if the .delegate property of my parser object indeed gets set to self. it does. there's probably a few dozen things that i tried as well, but practically i thinned it down to a very understandable class. there's still gotta be something that i'm missing. any ideas what it could be?... thanks.
Code:
- (bool)parseMyStuffFrom:(NSData *)xml into:(NSMutableArray *)here {
NSLog(@"goin' parsing...");
[self.error setString:@""];
// initialize and start the xml parser pump
NSXMLParser *pXML = [[NSXMLParser alloc] initWithData:xml];
[pXML setDelegate:self];
NSLog(@"here it comes");
[pXML parse];
NSLog(@"wuh.");
if ([pXML parserError]) {
// parsing error
NSLog(@"parsing error");
[self.error setString:@"malformed XML response"];
}
[pXML release];
return [self.error length];
}
Code:
2008-10-19 18:02:01.404 AppName[10325:20b] goin' parsing...
2008-10-19 18:02:01.463 AppName[10325:20b] here it comes
2008-10-19 18:02:01.464 AppName[10325:20b] *** -[NSCFString bytes]: unrecognized selector sent to instance 0x546640
2008-10-19 18:02:01.465 AppName[10325:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFString bytes]: unrecognized selector sent to instance 0x546640'
parserDidStartDocument:
parser: didStartElement: ...
parser: didEndElement: ...
parser: foundCharacters:
at one point i checked if the .delegate property of my parser object indeed gets set to self. it does. there's probably a few dozen things that i tried as well, but practically i thinned it down to a very understandable class. there's still gotta be something that i'm missing. any ideas what it could be?... thanks.