mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
removed duplicated (and buggy) implementations of "valueForKey:" and "setValue:forKey:" in CPArray.j
This commit is contained in:
@@ -972,38 +972,6 @@ CPEnumerationReverse = 1 << 1;
|
||||
return array;
|
||||
}
|
||||
|
||||
// Key value coding
|
||||
/*!
|
||||
Sets the key-value for each element in the array.
|
||||
@param aValue the value for the coding
|
||||
@param aKey the key for the coding
|
||||
*/
|
||||
- (void)setValue:(id)aValue forKey:(CPString)aKey
|
||||
{
|
||||
var i = 0,
|
||||
count = [self count];
|
||||
|
||||
for (; i < count; ++i)
|
||||
[self[i] setValue:aValue forKey:aKey];
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the value for \c aKey from each element in the array.
|
||||
@param aKey the key to return the value for
|
||||
@return an array of containing a value for each element in the array
|
||||
*/
|
||||
- (CPArray)valueForKey:(CPString)aKey
|
||||
{
|
||||
var i = 0,
|
||||
count = [self count],
|
||||
array = [];
|
||||
|
||||
for (; i < count; ++i)
|
||||
array.push([self[i] valueForKey:aKey]);
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
// Copying arrays
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user