Re: Difficulties with NSWindowController
Re: Difficulties with NSWindowController
- Subject: Re: Difficulties with NSWindowController
- From: Greg Titus <email@hidden>
- Date: Mon, 18 Jun 2001 20:18:38 -0700
On Monday, June 18, 2001, at 06:46 PM, Rob Rix wrote:
Hi, all.
I'm implementing a non-document based GUI app. It's got a New command
to allow you to open multiple windows. I have the New command connected
to a custom object (MetaAppController) with the action newWindow:.
I have the window in a separate nib file to (I thought) facilitate
having it open multiple times.
In newWindow:, I alloc an instance of NSWindowController, and use
initWithWindowNibName: to have it load the appropriate nib file. Only
difficulty is that although it appears to load the nib fine, it doesn't
get the window properly. That is, [theController window] returns nil
instead of the window from the nib file that theController loaded.
So, how do I remedy this?
Well, forgive me if this is too obvious, but have you connected the
"window" outlet of the "File's Owner" object in your nib to the window
in the nib? (In order to do that, you'd first need to select the file's
owner, and set its custom class (cmd-5) to NSWindowController in order
for IB to know that the owner _has_ an outlet named "window".)
Hope this helps,
--Greg