Re: NSWindowController confusion redux
Re: NSWindowController confusion redux
- Subject: Re: NSWindowController confusion redux
- From: Mike Abdullah <email@hidden>
- Date: Tue, 23 May 2006 11:53:40 +0100
You don't want to use the owner expression. The owner of the NIB
file should be the window controller you are creating, not the class
you are creating the window controller with.
I think the real issue here is the error message about failing to
load the nib file. Are you sure that:
* The "File's Owner" of the nib is NSWindowController
* The "File's Owner" has it's window outlet connected to the window
* The name of your nib file in the code is correct
I can't think of anything else off the top of my head, but I see no
reason your code shouldn't be working, I've certainly never had a
problem.
Mike.
On 23 May 2006, at 05:11AM, Ken Tozier wrote:
On May 22, 2006, at 4:14 AM, mmalcolm crawford wrote:
On May 22, 2006, at 1:02 AM, Ken Tozier wrote:
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette" owner: self];
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette"];
Thanks mmalc, but alas, no. Still getting a null window.
Running this:
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette"];
[mainPaletteController showWindow: self];
NSLog(@"window = %@", [mainPaletteController window]);
(No window appears on screen)
NSLog output:
2006-05-22 23:49:35.932 QuarkXPress[23268] -[NSWindowController
loadWindow]: failed to load window nib file 'MainPalette'.
2006-05-22 23:49:35.933 QuarkXPress[23268] window = (null)
Running this:
mainPaletteController = [[NSWindowController alloc]
initWithWindowNibName: @"MainPalette" owner: self];
[mainPaletteController showWindow: self];
NSLog(@"window = %@", [mainPaletteController window]);
(Window appears on screen)
NSLog output:
2006-05-22 23:55:18.749 QuarkXPress[23302] window = (null)
So it looks like the "owner" field is mandatory, at least in my case.
I guess I don't understand how a window can exist on screen and
behave normally at least as far as layer switching/moving around
the screen goes if nothing owns or has access to it. What could
possibly be the owner if not the window controller? Who's retaining
it? I'm not doing anything especially tricky here. Just open the
window and I want to hide it or show it in response to a menu
command. Those three lines are it as far as creation/
initialization goes.
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden