Re: NIB Init method for window subclasses
Re: NIB Init method for window subclasses
- Subject: Re: NIB Init method for window subclasses
- From: Matt Neuburg <email@hidden>
- Date: Wed, 25 Mar 2009 08:35:41 -0700
- Thread-topic: NIB Init method for window subclasses
On Wed, 25 Mar 2009 09:43:55 +0700, Ryan Joseph
<email@hidden> said:
>I have a window in a NIB file which I have assigned a class in the
>"Class Identity" field and corresponding NSWindow subclass in code.
>According to the reference (which is copied below) I think I should be
>receiving a initWithCoder: message (there are only 3 options) but I
>never get it. Custom classes and NSViews are both receiving init and
>initWithFrame: respectively. Should NSWindow be getting this message
>when it is instantiated from a NIB? If not, how do I know when
>NSWindows are instantiated?
No.
>Standard Interface Builder objects (and custom subclasses of those
>objects) receive an initWithCoder: message.
>In Mac OS X, the list of standard objects includes the views, cells,
>menus, and view controllers that are provided by the system and
>available in the default Interface Builder library
That didn't mention windows.
If you are using a window subclass, you'll receive awakeFromNib. Subclassing
NSWindow, however, merely to get an early message, would be unnecessary.
More typical is to use one of the many fine notifications / delegate
messages provided by the framework.
Hope this helps - m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden