On Aug 20, 2009, at 07:21, I. Savant wrote:

I'm not convinced yet that relying on -loadWindow is as good as keeping nib-loading-related startup code in -awakeFromNib.

a. I'm not sure how 'loadWindow' got into this discussion -- the documentation says not to call 'loadWindow' directly but to call 'window' instead and let *it* call 'loadWindow'.

b. 'window' won't return (presumably because an underlying 'loadNib...' doesn't return) until the NIB is completely loaded, including all the invocations of 'awakeFromNib' and the invocation of 'windowDidLoad'. AFAIK it's perfectly safe to invoke 'window' immediately after creating the window controller, or even during the window controller's init method (I've done both without problems).

The only difference is timing -- invoking 'window' early causes the NIB to be loaded at window controller creation time, instead of at the time the window is shown.

c. A couple of weeks ago on this list, one of our Apple experts (Luke, maybe, but I can't remember for sure) said to use the more specialized method (such as 'windowDidLoad') *instead of* the generic 'awakeFromNib', if the class has it.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to