mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
* Headers/Foundation/NSArray.h,
* Source/NSArray.m: Move -setValue:forKey: from NSMutableArray to NSArray. Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37464 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d770d1eeae
commit
1c6738c660
3 changed files with 26 additions and 21 deletions
|
@ -1731,6 +1731,24 @@ compare(id elem1, id elem2, void* context)
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Call setValue:forKey: on each of the receiver's items
|
||||
* with the value and key.
|
||||
*/
|
||||
- (void) setValue: (id)value forKey: (NSString*)key
|
||||
{
|
||||
unsigned i;
|
||||
unsigned count = [self count];
|
||||
volatile id object = nil;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
object = [self objectAtIndex: i];
|
||||
[object setValue: value
|
||||
forKey: key];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) enumerateObjectsUsingBlock: (GSEnumeratorBlock)aBlock
|
||||
{
|
||||
[self enumerateObjectsWithOptions: 0 usingBlock: aBlock];
|
||||
|
@ -2552,24 +2570,6 @@ compare(id elem1, id elem2, void* context)
|
|||
{
|
||||
[self sortWithOptions: 0 usingComparator: comparator];
|
||||
}
|
||||
|
||||
/**
|
||||
* Call setValue:forKey: on each of the receiver's items
|
||||
* with the value and key.
|
||||
*/
|
||||
- (void) setValue: (id)value forKey: (NSString*)key
|
||||
{
|
||||
unsigned i;
|
||||
unsigned count = [self count];
|
||||
volatile id object = nil;
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
object = [self objectAtIndex: i];
|
||||
[object setValue: value
|
||||
forKey: key];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSArrayEnumerator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue