• 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: Subclassing NSArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subclassing NSArray


  • Subject: Re: Subclassing NSArray
  • From: email@hidden
  • Date: Sun, 15 Sep 2002 09:18:04 -0400

You only need to implement the principal methods.

See the "Class Clusters" programming topic at <URL: file:///Developer/Documentation/Cocoa/TasksAndConcepts/ ProgrammingTopics/Foundation/
Concepts/ClassClusters.html> for more.

On Sunday, Sep 15, 2002, at 09:00 America/New_York, Timothy Larkin wrote:

I am having difficulty subclassing NSArray. The subclass does not inherit NSArray's methods. For instance, if MyThing is a subclass of NSArray, and A is an instance of MyThing, then [A count] produces an execution error that says:

2002-09-15 08:54:39.158 ArrayTest[14121] *** Uncaught exception: <NSInvalidArgumentException> *** -count only defined for abstract class. Define -[MyThing count]!

From this I gather that 'count' is defined only for the NSArray abstract class, and that a subclass of NSArray is expected to be a concrete class that explicity implements 'count'. However, I don't want to create an entire concrete class; I just want to subclass and add a few methods.

Is subclassing NSArray impossible? Do I need to use categories instead?
--
Timothy Larkin
Abstract Tools
Caroline, NY
_______________________________________________
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.
_______________________________________________
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: 
 >Subclassing NSArray (From: Timothy Larkin <email@hidden>)

  • Prev by Date: Re: Subclassing NSArray
  • Next by Date: Re: showing a checkbox and a pulldown-menu in a NSTableView
  • Previous by thread: Re: Subclassing NSArray
  • Next by thread: Property List Services and XML
  • Index(es):
    • Date
    • Thread