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

Re: Hiding superclass methods


  • Subject: Re: Hiding superclass methods
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 10 May 2002 01:02:52 +0200

On Friday, May 10, 2002, at 12:00 , email@hidden wrote:

|It is acceptable practice to do this, or should I explicitly call an
|additional initializer after my [[obj alloc] initWithFrame:] calls?

If you want your view to work when loaded from a nib file, you're pretty much forced to have *no* initializer (not even initWithFrame:), and to call a separate setData: method to supply the data. Views loaded from nib files never have initializers called,

Ammm... not really. They might got initWithCoder: for framework ones, and initWithFrame: for custom ones.

Nevertheless...

not even initWithFrame:, so any code you might put there would be executed only if you created the view explicitly in your application. (Initialization of views loaded from nib files has to be done in awakeFromNib.)

... this is completely right: anything loaded from NIB (not just views) should use awakeFromNib indeed.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >Re: Hiding superclass methods (From: email@hidden)

  • Prev by Date: Re: Saving NSColor
  • Next by Date: Re: Snap-to-edge palettes / dragging windows
  • Previous by thread: Re: Hiding superclass methods
  • Next by thread: Re: Hiding superclass methods
  • Index(es):
    • Date
    • Thread