Instantiating window from nib
Instantiating window from nib
- Subject: Instantiating window from nib
- From: Jeff LaMarche <email@hidden>
- Date: Sat, 13 Oct 2001 20:31:22 -0700
Okay, something I'm a little unclear on, but it seems like it must be
In all the examples and tutorials I've seen, window controller objects
are usually subclassed from NSObject; I've seen NSWindowController used
only in the context of Cocoa's multi-document architecture.
For the first time, I'm trying to create a moderately complex project
using more than one NIB (I am not using the multi-document
architecture). I have created a NIB file in addition to the main
application one, and have created a window in that NIB of which I want
to be able to instantiate multiple copies.
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.
TIA
Jeff