diff --git a/Source/NSKVOSupport.m b/Source/NSKVOSupport.m index c168a9372..cc3452f70 100644 --- a/Source/NSKVOSupport.m +++ b/Source/NSKVOSupport.m @@ -392,8 +392,8 @@ - (bool)isEmpty // Aggregate all keys whose values will affect us. if (dependents) { - NSSet *valueInfluencingKeys - = _keyPathsForValuesAffectingValueForKey([object class], key); + Class cls = [object class]; + NSSet *valueInfluencingKeys = [cls keyPathsForValuesAffectingValueForKey: key]; if (valueInfluencingKeys.count > 0) { // affectedKeyObservers is the list of observers that must be notified @@ -672,7 +672,7 @@ + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key + (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { - return _keyPathsForValuesAffectingValueForKey(self, key) ?: [NSSet set]; + return _keyPathsForValuesAffectingValueForKey(self, key) ?: [NSSet set]; // TODO(Hugo): Avoid constructing an empty set in every call } - (void)addObserver:(id)observer