FROM : Jens Alfke
DATE : Mon Jun 16 17:46:37 2008
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
DATE : Mon Jun 16 17:46:37 2008
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
| Related mails | Author | Date |
|---|---|---|
| David Harper | Jun 16, 17:07 | |
| David Harper | Jun 16, 17:27 | |
| Jens Alfke | Jun 16, 17:46 | |
| j o a r | Jun 16, 17:59 | |
| Jens Alfke | Jun 16, 18:04 |






Cocoa mail archive

