Re: Subclassing NSDictionary...
Re: Subclassing NSDictionary...
- Subject: Re: Subclassing NSDictionary...
- From: Andreas Schwarz <email@hidden>
- Date: Sat, 27 Apr 2002 11:56:11 -0700
Hopefully, this will be a quick answer by someone. I am trying to
subclass
NSMutableDictionary as follows (....)
I'm a little late into the game here, but I was surprised to note nobody
pointed out the obvious. There doesn't seem to be any need to subclass
in this case (at least based on the code given). It would do fine as a
category. (I'm a relative newbie to Objective-C and categories still
amaze me, they're so useful :-).
@interface NSMutableDictionary (SomeExtraStuff)
-(void) setSomeValue:(NSString *)theValue;
@end
@implementation NSMutableDictionary (SomeExtraStuff)
- (void) setSomeValue:(NSString *)theString
{
[self setObject:theString forKey:@"key"];
}
@end
Andreas Schwarz
http://homepage.mac.com/schwarz
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.