This discussion can backwards and forwards on the issue of ivars vs accessors, but it won't get anywhere definitive, because there is no answer that covers all cases.

All we've got is that Apple's currently recommended practice is to avoid accessors in initializers. Clear, but not absolute.

On Jan 9, 2009, at 21:09, Kyle Sluder wrote:

So what happens if Apple changes your superclass to observe itself?
All of a sudden you start firing KVO notifications off when you didn't
mean to.

It seems to me that would be a bug in the superclass. An object can't safely start observing itself in its initializer, because until the *original* initializer returns (i.e. the bottom-most subclass initializer), the address of 'self' is not irrevocably determined (any intermediate initializer can theoretically return a different object).


_______________________________________________

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