Re: Receiver type for instance message is a forward declaration
Re: Receiver type for instance message is a forward declaration
- Subject: Re: Receiver type for instance message is a forward declaration
- From: Roland King <email@hidden>
- Date: Wed, 11 May 2016 07:35:05 +0800
> On 11 May 2016, at 07:22, Carl Hoefs <email@hidden> wrote:
>
>>
>>
> Okay... It appears that for some odd reason, once in a blue moon, 'object' and 'keyPath' aren't what they're supposed to be, so I super it, and it blows.
> ….
>
> I will set 'context' and use it in my check instead.
> -Carl
Well you should also figure out why object and keyPath aren’t what they are supposed to be, because that’s the actual problem here, just checking the context isn’t really going to help you if you are getting notifications for keyPath ‘foo’ when you were expecting them for keyPath ‘bar’. You’ll just hide the issue until it comes back to bite you another way. If it was a case of another KVO up the inheritance chain then it wouldn’t fail if you passed the message to super. Cocoa doesn’t just randomly send out notifications to test you, they’re coming from somewhere.
What are object and keyPath which you don’t expect them to be?
Are you getting the warning anywhere in your debug logs that an object was deallocated whilst still having KVO notifications registered on it? That explicitly tells you that the KVO notifications can get attached to the wrong 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