• 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
Overriding methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overriding methods


  • Subject: Overriding methods
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sun, 24 Mar 2002 20:17:03 +0100

A subclass may override methods of its superclass. If it chooses not to, the superclass method is used. Correct?

So, NSMutableArray is a subclass of NSObject and inherits -init.

But when I use [ [ NSMutableArray alloc ] init ] I get no error message like:
"Please use initWithCapacity:", and it almost works - but only almost.

Should not NSMutableArray either override the inherited init-method in a documented way (e.g. with initWithCapacity: 0), or create an error message and have the non-usability of this method documented?

Same with NSButtonCell setBezelStyle and its superclass NSActionCell setBezeled.

Generally: should not the documentation clearly state (when not totally obvious) the function of inherited methods?

Gerriet.
_______________________________________________
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: Overriding methods
      • From: Ondra Cada <email@hidden>
  • Prev by Date: Re: NSSet Inefficiency
  • Next by Date: Re: 8-bit chars in @""
  • Previous by thread: Re: NSWindow makeFirstResponder bug?
  • Next by thread: Re: Overriding methods
  • Index(es):
    • Date
    • Thread