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: Roland King <email@hidden>
- Date: Fri, 20 May 2016 07:49:51 +0800
> On 20 May 2016, at 07:04, Roland King <email@hidden> wrote:
>
>
> Reading the original post he already has the warning about an object being deallocated whilst still having observers attached to it.
>
> This is simply a case of putting a breakpoint on dealloc and working out why the object is being deallocated before you’ve gone through the observation removal code you have.
.. and if you want a condition you can put on a conditional breakpoint inside dealloc (or swift equivalent), checking self.observationInfo != nil may help to get the right dealloc. And that object, even though it’s actually opaque and internal and not-to-be-used, when printed will reveal some hints about who is still observing you .. at least in objC, I’ve never got the right commands to make LLDB use the objC print to show it.
Just for clarity - I’m not suggesting using observationInfo to ‘prevent dealloc’, which you can’t do anyway and even if you could would be somewhere just the other side of insane, just to help filter out during debugging which dealloc to break on.
_______________________________________________
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