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: Sat, 12 May 2001 17:54:04 -0700
On Saturday, May 12, 2001, at 12:33 PM, g wrote:
On Saturday, May 12, 2001, at 11:00 AM, Ali Ozer wrote:
Of course right after posting this I remembered that initWithFrame:
should still be called for custom subclasses of NSView in IB which are
instantiated as views in IB; initWithCoder: is called in some less
common cases. Sounds to me like your case is the common case, which
should have been going through initWithFrame:. But you said
initWithFrame: wasn't called at all?
Correct. I was expecting initWithFrame: to be called from initWithCode:
but it wasn't. My view is a subclass of NSImageView and it doesn't have
any additional stored fields.
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.
if you dragged in a CustomView and set its class to MyImageView then
initWithFrame: will get called.
vince