diff --git a/ChangeLog b/ChangeLog index 3040bd1b4..98ddaf1e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-15 Fred Kiefer + + * Source/NSKeyValueObserving.m (-overrideSetterFor:): Replace + exception with log message. + * Source/NSKeyValueObserving.m (-addObserver:...context:): Use + original class as key for replacement. + 2007-12-15 Fred Kiefer * Source/NSKeyValueObserving.m (-overrideSetterFor:): Manually diff --git a/Source/NSKeyValueObserving.m b/Source/NSKeyValueObserving.m index 1da99fe61..cd2762c6b 100644 --- a/Source/NSKeyValueObserving.m +++ b/Source/NSKeyValueObserving.m @@ -339,10 +339,9 @@ static NSString *newKey(SEL _cmd) static GSKVOReplacement * -replacementForInstance(id o) +replacementForInstance(Class c) { - Class c = GSObjCClass(o); - GSKVOReplacement *r; + GSKVOReplacement *r; setup(); @@ -530,6 +529,8 @@ replacementForInstance(id o) if ([dependentKey isEqual: aKey]) { [self overrideSetterFor: mainKey]; + // Mark the key as used + [keys addObject: aKey]; found = YES; } } @@ -540,8 +541,11 @@ replacementForInstance(id o) if (!found) { + NSLog(@"class %@ not KVC complient for %@", original, aKey); + /* [NSException raise: NSInvalidArgumentException format: @"class not KVC complient for %@", aKey]; + */ } } } @@ -1100,7 +1104,8 @@ replacementForInstance(id o) setup(); [kvoLock lock]; - r = replacementForInstance(self); + // Use the original class + r = replacementForClass([self class]); /* * Get the existing observation information, creating it (and changing