Re: Nib owner's outlets
Re: Nib owner's outlets
- Subject: Re: Nib owner's outlets
- From: Rainer Brockerhoff <email@hidden>
- Date: Fri, 25 Jan 2002 13:56:27 -0200
>
Date: Thu, 24 Jan 2002 18:20:57 -0800
>
From: David Rehring <email@hidden>
>
>
On 1/24/02 4:25 PM, Rainer Brockerhoff at email@hidden wrote:
>
> Try this:
>
> ...
>
> [prefs window]; // inserted
>
> ...
>
> There is, of course, an explanation for this, but space precludes giving it
>
> here (actually, meaning, it's from the
>
> wave-a-dead-chicken-school-of-voodoo-programming, but it works somehow ;-)).
>
>
The reason why this is occuring is in the documentation for:
>
>
-window
>
>
In NSWindowController. Now, perhaps the documentation at the top of the
>
file should explicitly mention this, but I won't go into any of my rants
>
about documentation, HelpViewer or ProjectBuilder...
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.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"I love deadlines. I love the whooshing noise they make as they go by" (Douglas Adams)
http://www.brockerhoff.net/ (updated Jan. 2002)