From 818c7dac3da67511574ccae1c46f5b4b5b2a57e2 Mon Sep 17 00:00:00 2001 From: Francisco Ryan Tolmasky I Date: Fri, 24 Dec 2010 16:29:40 -0800 Subject: [PATCH] Fix for set accessor methods. Reveiwed by me. --- Foundation/CPKeyValueCoding.j | 4 ++-- Foundation/CPObject.j | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Foundation/CPKeyValueCoding.j b/Foundation/CPKeyValueCoding.j index 6074b580f..1bf4c9b65 100644 --- a/Foundation/CPKeyValueCoding.j +++ b/Foundation/CPKeyValueCoding.j @@ -89,8 +89,8 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey", accessor = accessors[aKey] = [1, @selector(_arrayValueForKey:)]; // Unordered to-many - else if ([theClass instancesRespondToSelector:sel_getUid("objectIn" + capitalizedKey + "atIndex:")] || - [theClass instancesRespondToSelector:sel_getUid(key + "AtIndexes:")]) + else if ([theClass instancesRespondToSelector:sel_getUid("enumeratorOf" + capitalizedKey)] || + [theClass instancesRespondToSelector:sel_getUid("memberOf" + capitalizedKey + ":")]) accessor = accessors[aKey] = [1, @selector(_setValueForKey:)]; } diff --git a/Foundation/CPObject.j b/Foundation/CPObject.j index d74fc11f7..cd8ff3994 100644 --- a/Foundation/CPObject.j +++ b/Foundation/CPObject.j @@ -471,6 +471,8 @@ CPLog(@"Got some class: %@", inst); */ - (CPString)className { + // FIXME: Why doesn't this work in KVO??? + // return class_getName([self class]); return isa.name; }