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: Carl Hoefs <email@hidden>
- Date: Tue, 10 May 2016 16:05:16 -0700
> On May 10, 2016, at 3:52 PM, Quincey Morris <email@hidden> wrote:
>
> On May 10, 2016, at 13:38 , Carl Hoefs <email@hidden <mailto:email@hidden>> wrote:
>>
>> At last, it blew again!
>
> Well, here’s the exception message:
>
>> An -observeValueForKeyPath:ofObject:change:context: message was received but not handled.
>> Key path: operations
>> Observed object: <NSOperationQueue: 0x14eae190>{name = 'Upload Queue'}
>> Change: {
>> kind = 1;
>> }
>> Context: 0x0
>
>
> So, some object has established itself as an observer of changes to the “operations” property of the NSOperationQueue named “Upload Queue”, but has failed to act on the observed change. Since the message says “received but not handled”, the likelihood is that the observer object *has* a method named 'observeValueForKeyPath:ofObject:change:context:’ (or one of its superclasses does), and is invoking the ‘super’ method to pass the change upwards to an ancestor class, but nothing actually handles it.
>
> The most likely cause is that the observer registered itself using ‘addObserver:forKeyPath:options:context:’ specifying a nil context, but is checking for a different context in 'observeValueForKeyPath:ofObject:change:context:’.
>
> It’s also possible that the exception message means something more obscure, in which case the cause may be more complicated, but you should search your code for ‘addObserver’ and ‘observeValueForKeyPath’, and make sure that the context is set and checked consistently. (Your code should *never* use a nil context explicitly.)
>
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?
-Carl
_______________________________________________
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