KVO returning nil for old values, and mmalc's Graphics Bindings example
KVO returning nil for old values, and mmalc's Graphics Bindings example
- Subject: KVO returning nil for old values, and mmalc's Graphics Bindings example
- From: Tim Lucas <email@hidden>
- Date: Wed, 18 May 2005 21:55:15 +1000
Hi all,
Did anybody figure out why in mmalc's Graphics Bindings example he had
to to the following workaround, because KVO wasn't returning the old
values?
Quoting "Graphics Bindings" example, GraphicsView.m,
observeValueForKeyPath:ofObject:change:context:
/*
Should be able to use
NSArray *oldGraphics = [change objectForKey:NSKeyValueChangeOldKey];
etc. but the dictionary doesn't contain old and new arrays...??
*/
I have come across exactly the same problem.
I have 4 different set of KVO's being registered within my view's bind:
method, and only the first one will return the old values in the change
dictionary when a change is observed, the other 3 return nil, even
though all the KVO registrations look like this:
[object addObserver:self
forKeyPath:key
options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld)
context:AContextPointer];
The context pointers look like:
static void *ContextPointerOne = (void *)1091;
static void *ContextPointerTwo = (void *)1092;
static void *ContextPointerThree = (void *)1093;
static void *ContextPointerFour = (void *)1094;
Any ideas?
- tim lucas
_______________________________________________
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