Skip navigation.
 
mlRe: awakeFromNib
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

Related mailsAuthorDate
mlawakeFromNib David Harper Jun 16, 17:07
mlawakeFromNib David Harper Jun 16, 17:27
mlRe: awakeFromNib Jens Alfke Jun 16, 17:46
mlRe: awakeFromNib j o a r Jun 16, 17:59
mlRe: awakeFromNib Jens Alfke Jun 16, 18:04