Re: accessing ivars in - (id)init
Re: accessing ivars in - (id)init
- Subject: Re: accessing ivars in - (id)init
- From: Quincey Morris <email@hidden>
- Date: Fri, 9 Jan 2009 21:31:02 -0800
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@hidden)
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:
This email sent to email@hidden