Re: NIB Init method for window subclasses

On Wed, 25 Mar 2009 09:43:55 +0700, Ryan Joseph
<thealchemistguild@xxxxxxxxx> 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?


>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 = matt@xxxxxxxxxxx, <>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!


Cocoa-dev mailing list (Cocoa-dev@xxxxxxxxxxxxxxx)

Please do not post admin requests or mode...

rator comments to the list.
Contact the moderators at cocoa-dev-admins(at)

Help/Unsubscribe/Update your Subscription:

This email sent to maillists@xxxxxxxxx