On Wed, 17 Feb 2010 17:07:54 -1000, Dave Keck <davek...@gmail.com> said: >> 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. > >This isn't true for 10.5; both -initWithFrame: and -awakeFromNib are >called if the view was instantiated via the NIB machinery. I suspect >10.6 is no different.
OK, but in that case I would use a flag to make sure that my single method is called no more than once. I don't know whether this applies to the OP's actual use case; I'm just saying, when I am not sure which of several routines will be called or in what order and I want to make sure a certain thing happens, I just factor out that certain thing. m. -- matt neuburg, phd = m...@tidbits.com, <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 (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