Re: Q: Designated initializers: what are they?
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