Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File's Owner



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/


References: 
 >Re: File's Owner (From: Peter Sichel <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.