Re: -observeValueForKeyPath:ofObject:change:context: only defined for abstract class.
Re: -observeValueForKeyPath:ofObject:change:context: only defined for abstract class.
- Subject: Re: -observeValueForKeyPath:ofObject:change:context: only defined for abstract class.
- From: Todd Ransom <email@hidden>
- Date: Fri, 6 Jan 2006 11:29:33 -0700
I have never called super in my KVO methods. All you should need to
do is make your changes using the observed objects. What are you
trying to accomplish when the observed objects change?
Todd Ransom
Return Self Software
http://returnself.com
On Jan 5, 2006, at 1:40 PM, David Burnett wrote:
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
_______________________________________________
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