• 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: Q: Designated initializers: what are they?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q: Designated initializers: what are they?


  • Subject: Re: Q: Designated initializers: what are they?
  • From: Vince DeMarco <email@hidden>
  • Date: Sun, 13 May 2001 19:17:49 -0700

On Saturday, May 12, 2001, at 06:32 PM, Arno wrote:


On Saturday, May 12, 2001, at 05:54 PM, Vince DeMarco wrote:
How did you setup your NSImageView sublcass?? If you dragged in a ImageView and then set its class to MyImageView, then initWithFrame: will never get called.

Yes, that's what I did, but I fail to see the logic in this.



When you drag an ImageView from the palette you get to set up any attribute on the object, Because of this the attributes you set need to be saved. What happens in the nib file is the superclass NSImageVIew gets archived then when we load in the nib file we swap MyImageView for NSImageView.

When you use a custom view the only setting that is available in IB is the objects size and placement (ie its frame) and since we don't archive the object we can call the designated initializer and set the object up.

vince


References: 
 >Re: Q: Designated initializers: what are they? (From: Arno <email@hidden>)

  • Prev by Date: Re: Type/Creator codes
  • Next by Date: NSOutlineView from Java or Bust
  • Previous by thread: Re: Q: Designated initializers: what are they?
  • Next by thread: NSSound
  • Index(es):
    • Date
    • Thread