Re: File's Owner
Re: File's Owner
- Subject: Re: File's Owner
- From: "Clark S. Cox III" <email@hidden>
- Date: Fri, 30 Nov 2001 16:49:28 -0500
On Friday, November 30, 2001, at 04:23 , Peter Sichel wrote:
At 12:30 PM -0800 11/30/01, John C. Randolph wrote:
On Friday, November 30, 2001, at 12:04 PM, email@hidden wrote:
In two cases I have not been able to figure out what "File's
Owner" does in the Interface Builder window.
The "File's Owner" is a stand-in for whatever object loads the
nib file. In the case of MainMenu.nib, this will typically be
the NSApplication instance.
-jcr
This seemingly undocumented detail becomes critical if you
It is documented, in IB's FAQ.
subclass NSWindowController to manage windows in separate
nib files.
You must make the "File's Owner" be the Window
controller by setting its custom class and connect your
window to it. Otherwise your NSWindowController subclass
will not connect properly to the window when the nib file
is loaded.
From the documentation for NSWindowController:
- (id)initWithWindowNibName:(NSString *)windowNibName
... Sets the owner of the nib file to the receiver ...
- (id)initWithWindowNibName:(NSString *)windowNibName owner:(id)owner
... The owner argument is the nib file's owner ...
Although it could be a bit more clear.
--
Clark S. Cox, III
email@hidden
http://www.whereismyhead.com/clark/