• 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: Confusing problems with inheritance in Objective-C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Confusing problems with inheritance in Objective-C (From: Darren Ford <email@hidden>)

  • Prev by Date: Re: Confusing problems with inheritance in Objective-C
  • Next by Date: Re: Confusing problems with inheritance in Objective-C
  • Previous by thread: Re: Confusing problems with inheritance in Objective-C
  • Next by thread: Re: Confusing problems with inheritance in Objective-C
  • Index(es):
    • Date
    • Thread