Re: best time to alter GUIs
Re: best time to alter GUIs
- Subject: Re: best time to alter GUIs
- From: Ken Thomases <email@hidden>
- Date: Mon, 3 Mar 2008 13:05:20 -0600
On Mar 3, 2008, at 11:12 AM, Daniel Child wrote:
On Mar 1, 2008, at 6:15 AM, Ken Thomases wrote:
Does your init method do anything else other than calling [super
initWithWindowNibName:]? In particular, if it calls [self
window], that forces the loading (and awakening) of the NIB in
order to reconstitute the window.
My bad. I should have checked that, and assumed it simply passed
the address. If [self window] loads things, is there any way to
obtain the window's address without loading it?
That question is nonsensical. There is no window until it's loaded,
therefore there is nothing to have the address of.
I found it useful to assign a (superfluous) instance variable since
I was doing so much with the window. I didn't want to have to use
[self window] each time, especially if [self window] actually tries
to load each time.
[self window] returns the window, loading it if necessary. That is,
it only loads it once. This is all documented in the
NSWindowController docs. You can cache this value if you want, but
that's redundant since NSWindowController is already "caching" it for
you. Also, you then run the risk of forcing the window to load
before it's strictly necessary, as you've discovered.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden