• 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: Overiding NSButton initWithFrame: (doesn't work)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overiding NSButton initWithFrame: (doesn't work)


  • Subject: Re: Overiding NSButton initWithFrame: (doesn't work)
  • From: email@hidden
  • Date: Sat, 2 Feb 2002 10:27:46 -0800

When un-archiving, ie from a nib, the designated initializer is -
(id)initWithCoder:(NSCoder *)decoder

Yes, but use the awakeFromNib method instead that is what its there for.

Hmm. If you're doing stuff that you always want done when you get created by NSCoder, whether from a nib, a pasteboard, an object archive file, or whatever, then you should override -initWithCoder:. Overriding -awakeFromNib would be appropriate only when you have things that you want to do specifically and only when you are awakened from a nib. Right?
That said, I don't remember the context of the original issue well enough to recall which of these was the case there...

Ben Haller
Stick Software


  • Prev by Date: _iVar prefixes (was Re: Draggable buttons)
  • Next by Date: Re: Dumb mistake, I'm sure...
  • Previous by thread: Re: Overiding NSButton initWithFrame: (doesn't work)
  • Next by thread: Re: Overiding NSButton initWithFrame: (doesn't work)
  • Index(es):
    • Date
    • Thread