Re: awakeFromNib
Re: awakeFromNib
- Subject: Re: awakeFromNib
- From: Jens Alfke <email@hidden>
- Date: Mon, 16 Jun 2008 08:46:37 -0700
On 16 Jun '08, at 8:07 AM, David Harper wrote:
I am setting up a preferences window, and I would like awakeFromNib:
to be invoked earlier than it does. Currently, it only gets invoked
when the preferences window is shown / opened.
Well, -awakeFromNib won't be called until the nib is loaded, of
course. You can prevent the window from showing up when the nib is
loaded by unchecking the window's "Visible At Launch" checkbox. You
can then load the nib and the window won't automatically appear;
you'll have to call -makeKeyAndOrderFront: or something like that on it.
On the other hand, it sounds like you might want your code to run when
the app launches; and loading the prefs nib then would be wasteful.
You might want to refactor your code so the stuff that needs to be
always available isn't dependent on the nib being loaded. (That should
help improve the model/view separation, too.)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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
References: | |
| >awakeFromNib (From: David Harper <email@hidden>) |