On Wed, 17 Feb 2010 09:23:57 +0000, Keith Duncan <[email protected]>
said:
>
>On 16 Feb 2010, at 21:40, David Duncan wrote:
>
>>> Calling it in -initWithFrame: is too early and the view fails to 'draw'.
>> 
>> If you are creating the view programmatically, -initWithFrame: should be
fine. If your loading from a nib, then -awakeFromNib is the appropriate place.
>
>That's actually a more distilled version of my question. When your layer
hosting view may be instantiated programatically, or from a NIB; there is no
good place that covers both since the -init methods are too early

Maybe I'm misunderstanding, but I'm wondering, why not put everything into a
single method and call that method from both initWithFrame and awakeFromNib?
One and only one of these will be called (depending whether you are
instantiating in code or in a nib), so your single method will be called
exactly once and you're off to the races. m.

-- 
matt neuburg, phd = [email protected], <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to