Re: Console: *** -observeValueForKeyPath:... only defined for abstract class
Re: Console: *** -observeValueForKeyPath:... only defined for abstract class
- Subject: Re: Console: *** -observeValueForKeyPath:... only defined for abstract class
- From: Thomas Engelmeier <email@hidden>
- Date: Mon, 24 Sep 2007 11:04:24 +0200
On 24.09.2007, at 01:55, Jerry Krinock wrote:
Sometimes, while manipulating the control or the model data which
is bound into this array controller, I get the following message in
the console:
*** -observeValueForKeyPath:ofObject:change:context: only defined
for abstract class.
Define -[NSKeyValueObservance
observeValueForKeyPath:ofObject:change:context:]!
The method referred to there is is the workhorse which we use to
receive KVO notifications. It is defined in the
"NSKeyValueObserving Protocol Reference"
API. The protocol overview says that it is "provided" for "all
objects", although it is informal.
So, what might they mean "only defined for abstract class"?? The
API does not say anything about "abstract classes".
Without going into detail for your specific problem, I'd try to break
when that message is output and then inspect which object outputs the
message. The API will not tell you about "abstract classes" because
they are not an API concept but an programming pattern. Quoting the
book "Design Patterns", "An abstract class is one whose main purpose
is to define the interface for it's subclasses". Note it is a pretty
common C++ idiom, but rather rare in Objective-C, where protocols are
used for interfaces.
If you are lucky, a breakpoint on [NSException raise] or NSLog will
work.
If the error does not occur 100% reproducible, it might be bad memory
management - an object deallocated and in the same memory location
repalced with something completely different, whose method is invoked.
_______________________________________________
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