Re: Instantiating window from nib
Re: Instantiating window from nib
- Subject: Re: Instantiating window from nib
- From: Drew McCormack <email@hidden>
- Date: Sun, 14 Oct 2001 10:59:07 -0700
I notice that NSWindowController has a method called
(id)initWithWindowNibName:(NSString *)windowNibName. This would make me
think that the correct way to handle this situation would be to subclass
NSWindowController rather than NSObject for my window controller object
in the NIB. I don't see any method in NSWindow or NSObject that would
allow me to create this window otherwise.
Is this the correct way to handle a window/windowcontroller in a NIB
outside the main one, or do I need to manually load the NIB somehow? Any
info is appreciated on doing this.
You do indeed subclass NSWindowController. You can use the 'init...'
method you referred too, or you can override the 'windowNibName' method,
and use a different init method. Even if you don't use the
multiple-document architecture, you could start up a new MD project, and
look at the methods which the window controller defines. These include
some comments which may help you understand how it all fits together.
Drew McCormack