Re: iOS - the joy of observers and NSInternalInconsistancyException for KVO
Re: iOS - the joy of observers and NSInternalInconsistancyException for KVO
- Subject: Re: iOS - the joy of observers and NSInternalInconsistancyException for KVO
- From: Jens Alfke <email@hidden>
- Date: Thu, 19 May 2016 09:41:57 -0700
> On May 19, 2016, at 7:51 AM, Alex Zavatone <email@hidden> wrote:
>
> Is there a means to have an object know when it's being observed so that it will refuse to nuke itself in this condition?
Nope. Remember, objects don’t “nuke” themselves; they are dealloced when no other objects have references to them. It’s the observer’s responsibility to retain a reference to the target object (observee?) for as long as it’s observing that object. Or at least to have some means of detecting that the target object is going to go away, and removing itself as an observer then.
—Jens
_______________________________________________
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