-observeValueForKeyPath:ofObject:change:context: only defined for abstract class.
-observeValueForKeyPath:ofObject:change:context: only defined for abstract class.
- Subject: -observeValueForKeyPath:ofObject:change:context: only defined for abstract class.
- From: David Burnett <email@hidden>
- Date: Thu, 05 Jan 2006 20:40:04 +0000
I'm trying to perform some KVO'ing
It all appears to work but I get the following message in the
Run Log.
-observeValueForKeyPath:ofObject:change:context: only defined for
abstract class. Define -[FlameController
observeValueForKeyPath:ofObject:change:context:]!
FlameController looks like this...
@interface FlameController : NSObject
{
...
}
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context;
@implementation FlameController
...
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context
{
if ([keyPath isEqual:@"time"]) {
NSLog(@"old time: %@, new time: %@\n",
[change objectForKey:NSKeyValueChangeOldKey],
[change objectForKey:NSKeyValueChangeNewKey]);
}
[super observeValueForKeyPath:keyPath
ofObject:object
change:change
context:context];
}
...
@end
It appears it's the call to super that generates the error, but the
doc's claim that NSObject implements the KVO informal protocol. If
I take out the call to super the value does not get updated.
What I'm I doing wrong ?
Is there a better class to subclass for FlameControlller ?
Am I supposed to update the observed object myself ?
Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden