Skip to content

Instantly share code, notes, and snippets.

@boucher
Created May 6, 2010 14:53
Show Gist options
  • Save boucher/392202 to your computer and use it in GitHub Desktop.
Save boucher/392202 to your computer and use it in GitHub Desktop.
diff --git a/Foundation/CPKeyValueObserving.j b/Foundation/CPKeyValueObserving.j
index b88f766..10e6dd5 100644
--- a/Foundation/CPKeyValueObserving.j
+++ b/Foundation/CPKeyValueObserving.j
@@ -486,6 +486,8 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
var changeOptions = [CPDictionary dictionaryWithObject:CPKeyValueChangeSetting forKey:CPKeyValueChangeKindKey];
[[_CPKVOProxy proxyForObject:self] _sendNotificationsForKey:aKey changeOptions:changeOptions isBefore:YES];
+
+ [super willChangeValueForKey:aKey];
}
- (void)didChangeValueForKey:(CPString)aKey
@@ -494,6 +496,8 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
return;
[[_CPKVOProxy proxyForObject:self] _sendNotificationsForKey:aKey changeOptions:nil isBefore:NO];
+
+ [super didChangeValueForKey:aKey];
}
- (void)willChange:(CPKeyValueChange)change valuesAtIndexes:(CPIndexSet)indexes forKey:(CPString)aKey
@@ -504,6 +508,8 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
var changeOptions = [CPDictionary dictionaryWithObjects:[change, indexes] forKeys:[CPKeyValueChangeKindKey, CPKeyValueChangeIndexesKey]];
[[_CPKVOProxy proxyForObject:self] _sendNotificationsForKey:aKey changeOptions:changeOptions isBefore:YES];
+
+ [super willChange:change valuesAtIndexes:indexes forKey:aKey];
}
- (void)didChange:(CPKeyValueChange)change valuesAtIndexes:(CPIndexSet)indexes forKey:(CPString)aKey
@@ -512,6 +518,8 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew|CPKeyValueObservingOptionOld,
return;
[[_CPKVOProxy proxyForObject:self] _sendNotificationsForKey:aKey changeOptions:nil isBefore:NO];
+
+ [super didChange:change valuesAtIndexes:indexes forKey:aKey];
}
- (Class)class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment