Re: devil of a time with an NSImageView
Re: devil of a time with an NSImageView
- Subject: Re: devil of a time with an NSImageView
- From: Quincey Morris <email@hidden>
- Date: Thu, 20 Aug 2009 10:12:26 -0700
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 (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