CPArrayController works simply with bindings and arrangedObjects

This commit is contained in:
Ross Boucher committed 2009-02-19 01:29:39 -08:00
1 parent 4de3a34a3e
commit 9bbe51fa64
5 files changed
+73 -54

No files matched your search

+7 -9
View File
@@ -173,17 +173,15 @@ CPUnknownUserInfoKey = @"CPUnknownUserInfoKey";
- (id)valueForKeyPath:(CPString)aKeyPath
{
var keys = aKeyPath.split("."),
index = 0,
count = keys.length,
value = self;
var dotIndex = aKeyPath.indexOf(".");
for(; index < count; ++index)
value = [value valueForKey:keys[index]];
if (dotIndex === CPNotFound)
return [self valueForKey:aKeyPath];
return value;
var firstPart = aKeyPath.substring(0, dotIndex),
secondPart = aKeyPath.substring(dotIndex+1);
return [[self valueForKey:firstPart] valueForKeyPath:secondPart];
}
- (CPDictionary)dictionaryWithValuesForKeys:(CPArray)keys