Re: Confusing problems with inheritance in Objective-C
Re: Confusing problems with inheritance in Objective-C
- Subject: Re: Confusing problems with inheritance in Objective-C
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 21 Jun 2004 21:07:37 -0600
On Jun 21, 2004, at 8:31 PM, Darren Ford wrote:
What I'm finding is that when one of my methods (for example, the
'setDate' function below), that when it attempts to call the super's
method, I get the error :-
-setObject:forKey: only defined for abstract class. Define
-[MyInheritedDictionaryClass setObject:forKey:]'
Isn't NSMutableDictionary a concrete class (ie. I can instantiate
one using alloc/init?)
No, it isn't; NS(Mutable)Dictionary is a class cluster and can not be
_easily_ subclassed. What you want to do instead is add a category. See
page 70 of "The Objective-C Programming Language" for details on
categorizing.
Nick Zitzmann
<
http://www.chronosnet.com/>
_______________________________________________
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.