On Aug 3, 2009, at 5:03 PM, Kiel Gillard <kiel.gill...@gmail.com> wrote:
Unless, of course, you have code in your setter method that handles changes to and from nil. For example, you may add or remove self as an observer for keypaths of an different object value. This would save repeating the change handling code in your init, setter and dealloc methods.

No, this is precisely what you should not do. -init and -dealloc should not invoke accessor methods, because the object is in a partially constructed state that subclasses (including the dynamically created ones KVO makes) often can't handle.

--Kyle Sluder
_______________________________________________

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