I've been having 2 intermittent compilation errors on 10.3.9 in - (BOOL)loadDataRepresentation:(NSData*)data ofType:(NSString*)fileType { BOOL success; NSString * lowercaseFileType = [fileType lowercaseString]; NSLog(@"fileType=%S", lowercaseFileType); if ([lowercaseFileType isEqualToString:@"abc"]) { JGOAbcParser * abcParser = [[JGOAbcParser alloc] initFromAbcData:data]; if (abcParser) success = YES; } else if ([lowercaseFileType isEqualToString:@"defg"]) { NSXMLParser * xmlParser = [[NSXMLParser alloc] initWithData:data]; [xmlParser setDelegate:JGOXMLParser]; success = [xmlParser parse]; } [...] return success; }
The first is a warning where I try to log the file type, grumping that the 2nd argument is not of the desired type. (Converting it to lower case was an attempt to see whether it would affect the warning, and at first I thought it did. But, in any case, it makes the later if condition simpler.) The second is error: parse error before "JGOXMLParser" and point to [xmlParser setDelegate:JGOXMLParser]; I understand that – loadDataRepresentation:ofType: method is valid in 10.3.9 but deprecated in 10.4 but I have to work with what I have. Does the delegate have to be an instance? If so, would I instantiate it right before setting the delegate? The manuals and examples are not enlightening, since most simply [fred setDelegate:self] Do I have to implement all delegate methods? I am under the impression it would check and revert to defaults on ones that I did not. Here are the declarations of the ones I have, now: - (void)parserDidStartDocument:(NSXMLParser*)parser; - (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qName attributes:(NSDictionary*)attributeDict; - (void)parser:(NSXMLParser*)parser foundCharacters:(NSString*)string; - (void)parserDidEndDocument:(NSXMLParser*)parser; And, finally, what is that namespaceURI parameter? The descriptions are non-descriptive to me. Is that supposed to be a URI to a DTD or XML schema, or something completely different? Since it's not doing validation, I was hoping to dispense with a DTD or schema, for now, and just pick and choose what tags to process. manuals, etc., consulted: _Event-Driven XML Programming Guide for Cocoa_ _Application Architecture Overview_ _Document-Based Applications Overview_ _NSDocument Class Reference_ Aaron Hillegass 2002 _Cocoa Programming for Mac OS X_ http://www.w3schools.com/ _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com