Re: exception in class derived from NSMutableDictionary
Re: exception in class derived from NSMutableDictionary
- Subject: Re: exception in class derived from NSMutableDictionary
- From: Dylan Adams <email@hidden>
- Date: Wed, 30 Jul 2003 12:48:42 -0500
Prachi Gauriar wrote:
I don't think providing a category would work in this case, because
you're dealing with a class cluster.
Categories work fine with class clusters. All components of the
Dictionary class cluster are subclasses of the public class NSDictionary
and some of the public class NSMutableDictionary. Subclasses inherit
methods added by categories just as they inherit any method defined in
their superclasses. So, just add a category on NSDictionary (or, in this
case, NSMutableDictionary) and it would be added to any subclass of it.
Are you sure this isn't a has-a relationship instead of an is-a
relationship? That is, could your class VideoSensorCollection just
have an NSMutableDictionary instance variable that you then cover
with some add and remove methods instead of subclassing?
I agree.
dylan
_______________________________________________
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.