KVO observeValueForKeyPath, not reflecting changes
KVO observeValueForKeyPath, not reflecting changes
- Subject: KVO observeValueForKeyPath, not reflecting changes
- From: "Smith, Steven (MCP)" <email@hidden>
- Date: Fri, 27 Apr 2007 14:09:55 -0000
- Thread-topic: KVO observeValueForKeyPath, not reflecting changes
Hello folks,
I've got a pretty simple (or so I thought) KVC/KVO where I'm wanting
to observe
changes in an NSTableView column.
I register as an observer with
:
[theArrayController addObserver:self forKeyPath:@"selection.dValue"
options:(NSKeyValueObservingOptionNew |
NSKeyValueObservingOptionOld)
context:@"dValue"];
:
Then I have the KVO:
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void*)context
{
if ([keyPath isEqualToString:@"selection.dValue"] && context ==
@"dValue")
{
NSLog(@"change = %@", change);
id v = [change valueForKey:NSKeyValueChangeNewKey];
NSLog(@"v=%@", v);
}
}
When I change a value in "dValue"-column the
observeValueForKeyPath:ofObject:change:context always returns:
change = {kind = 1; new = <null>; old = <null>; }
v=<null>
Searching through the different lists I've found one that said this was
a bug but that was in 2004.
My code snippet is almost exactly what is in the "Key-Value Observing
Programming Guide"
Any ideas? Or does anyone know if this IS a bug and any work-arounds?
Thanks in advance,
Steven
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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