Re: Nib owner's outlets
Re: Nib owner's outlets
- Subject: Re: Nib owner's outlets
- From: David Rehring <email@hidden>
- Date: Fri, 25 Jan 2002 11:59:38 -0800
On 1/25/02 7:56 AM, Rainer Brockerhoff at email@hidden wrote:
>
I've looked this up, and all it says is:
>
>
"Returns the window owned by the receiver or nil if there isn't one. If the
>
window has not yet been loaded, it attempts to load the window's nib file
>
using loadWindow. Before it loads the window, it invokes windowWillLoad in
>
subclass implementations and, if the NSWindowController has a document, it
>
invokes the NSDocument's corresponding method windowControllerWillLoadNib: (if
>
implemented). After loading the window, it invokes windowDidLoad and, if there
>
is a document, the NSDocument method windowControllerDidLoadNib: (if
>
implemented)."
>
>
OK, so it seems that the nib file is loaded by loadWindow inside this call...
>
I always thought the preceding -initWithWindowNibName call did this already.
>
Should be easy to check...
>
>
...anyway, the documentation should clearly state at which point the outlets
>
are connected. The text for initWithWindowNibName:owner: says: "Returns an
>
NSWindowController object initialized with windowNibName and owner..." and I
>
always thought "initialized" also meant loading the nib file, instead of just
>
storing the nib file name and owner.
>
You have to 'read between the lines'.
Start with "if the window has not yet been loaded".
This implies that sometimes, NSWindowController objects will have been
created, but the associated nib would NOT be loaded [so any associated
outlets that would be filled in when the nib is loaded would not be
changed].
When I was figuring this out, I then checked out loadWindow, which says not
to call it directly, but to call window...
You have to link "outlets not initialized" with "nib not loaded".
The 'return nil if there isn't one' had me confused before as well, but I
guess if the nib file didn't attach a window object to the
NSWindowController/file owner...
Later,
--
David Rehring Psychos do not explode when light hits
Senior Software Engineer them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!