• 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: only defined for abstract class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: only defined for abstract class


  • Subject: Re: only defined for abstract class
  • From: "Mark Munz (DevList)" <email@hidden>
  • Date: Thu, 6 Oct 2005 09:35:42 -0500

Ah, I guess I skipped that section (since I already know what the class does).

NSMutableData and NSData action have a section above the Class Description which specify the Primitive Methods of the class. I think an explicit section makes it much easier to find, rather than embedding it in the class description. NSArray's mention of primitives (now that I'm looking at it) is in paragraph format.

Given the care that's taken to indicate "commonly used methods", I think "primitive methods" are as valuable if not more so in the case of subclassing.

There does seem to be real inconsistency in how this is documented.

Mark

On Oct 6, 2005, at 9:23 AM, Greg Herlihy wrote:

The five "primitive" NSMutableArray methods are documented in the first
paragraph of the NSMutableArray entry in the Core Foundation Reference. So
they are not all that difficult to find:


    addObject:
    insertObject:atIndex:
    removeLastObject
    removeObjectAtIndex:
    replaceObjectAtIndex:withObject:

Greg

On 10/6/05 7:10 AM, "Mark Munz (DevList)" <email@hidden> wrote:



On Oct 6, 2005, at 2:47 AM, Francis Derive wrote:


From what I have read, here I override the 2 inherited "primitive" methods -count and -objectAtIndex:


I'm assuming that the mutable version has an additional primitive
that has to be overridden. Unfortunately Apple documentation on Class
Clusters isn't great. Specifically, documenting which classes ARE
class clusters and what the primitive methods for each are. NSData
and NSMutableData documents what primitive methods are, NSArray and
NSMutableArray do not.

I would file bugs on the documentation.


..




And I believe you'll need to override an additional method for storing the object in the case of sublcassing NSMutableArray. Not sure which method that is, as it isn't documented (as far as I can tell) and I haven't had to do it myself.

Hopefully that helps a bit.

Mark Munz

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden







_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: only defined for abstract class (From: Greg Herlihy <email@hidden>)

  • Prev by Date: Re: No Reference to Table Column
  • Next by Date: Re: NSTableView issues
  • Previous by thread: Re: only defined for abstract class
  • Next by thread: Re: only defined for abstract class
  • Index(es):
    • Date
    • Thread