On Sat, Nov 14, 2009 at 11:35 PM, Ariel Feinerman <arielfap...@gmail.com> wrote: > 2009/11/15 Kyle Sluder <kyle.slu...@gmail.com> > >> On Sat, Nov 14, 2009 at 2:35 PM, Ariel Feinerman <arielfap...@gmail.com> >> wrote: >> > I need two versions of -initWith ... and -set ... methods of custom timer >> > class (for example, to prevent the circle references); >> >> Do not use accessors in your initializers or -dealloc. >> > > Hm, it means to do the same work two times, I think. For example if I change > the mechanism in the setting of instance variables, I must to change one in > difference inits method; can you say a reason?
The reason often given (to which I don't personally subscribe) is that the accessor could be overridden in a subclass, and therefore do things that aren't appropriate (i.e. they could assume something about the already-dealloc'ed or not-yet-init'ed portions of the subclass). -- Clark S. Cox III clarkc...@gmail.com _______________________________________________ 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