• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: exception in class derived from NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: exception in class derived from NSMutableDictionary
      • From: Robert G Palmer Jr <email@hidden>
References: 
 >exception in class derived from NSMutableDictionary (From: Robert G Palmer Jr <email@hidden>)
 >Re: exception in class derived from NSMutableDictionary (From: Prachi Gauriar <email@hidden>)

  • Prev by Date: Re: Repost: NSTableView headaches (please help!)
  • Next by Date: Re: exception in class derived from NSMutableDictionary
  • Previous by thread: Re: exception in class derived from NSMutableDictionary
  • Next by thread: Re: exception in class derived from NSMutableDictionary
  • Index(es):
    • Date
    • Thread