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:19:45 +0800
> On 11 May 2016, at 07:11, Jens Alfke <email@hidden> wrote:
>
>
>> On May 10, 2016, at 4:05 PM, Carl Hoefs <email@hidden> wrote:
>>
>> Yes, yes, and yes! I'm using a nil context. I'm not sure how context is to be used here... Is this an arbitrary value that I check in -observeValueForKeyPath?
>
> Yes, but I’m not aware of it being required … what goes wrong if it’s NULL, Quincey?
>
> —Jens
nothing goes wrong if it’s null, however you can’t tell which observations are yours and which belong to one of the other classes in the inheritance chain who are also potentially using KVO.
However lots of people use nil for it and get away with it, but don’t. You will one-day handle the KVO notifications for something which isn’t you and starve it of doing so.
Either way - this KVO notification has been passed to the superclass hence the exception. I’d doubt it’s because of the context, more likely that he’s comparing the notification name string incorrectly and not handling it, or handing the KVO and then *still* calling the superclass method.
_______________________________________________
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