Re: Open a window created in another nib
Re: Open a window created in another nib
- Subject: Re: Open a window created in another nib
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 28 Dec 2005 02:30:55 -0800
On Dec 28, 2005, at 2:02 AM, Andrea Salomoni wrote:
I created MYWindowController class as a subclass of
NSWindowController yet, the problem is that if I write
NSLog (@"window name:%@", [self window]);
returns nil...
That's almost certainly because it hasn't loaded the nib file...
You should initialise theSecondWin with initWithWindowNibName: --
see <http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSWindowController.html#//
apple_ref/occ/instm/NSWindowController/initWithWindowNibName:>
Also, again, you don't instantiate an instance of the window
controller in a nib, it should be the File's Owner -- you set the
class of the File's Owner to be your NSWindowController subclass.
See <
http://developer.apple.com/documentation/Cocoa/Conceptual/
Documents/Concepts/WinControllersAndNibs.html>.
mmalc
_______________________________________________
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