mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-15 04:54:29 +00:00
CPArrayController works simply with bindings and arrangedObjects
This commit is contained in:
1 parent
4de3a34a3e
commit
9bbe51fa64
5 files changed
+73
-54
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user