> On 11 May 2016, at 07:22, Carl Hoefs <[email protected]> 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 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to