mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 17:10:48 +00:00
Added missing method -valueForKey: in NSSet
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37624 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f1b7c46f50
commit
7e1b8d8197
2 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2014-01-20 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Source/NSSet.m (-valueForKey:): Added missing method (-valueForKeyPath:
|
||||
is already implemented).
|
||||
|
||||
2014-01-20 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Source/NSKeyValueMutableArray.m:
|
||||
|
|
|
@ -625,6 +625,24 @@ static Class NSMutableSet_concrete_class;
|
|||
return [[self allObjects] descriptionWithLocale: locale];
|
||||
}
|
||||
|
||||
- (id) valueForKey: (NSString*)key
|
||||
{
|
||||
NSEnumerator *e = [self objectEnumerator];
|
||||
id object = nil;
|
||||
NSMutableSet *results = [NSMutableSet setWithCapacity: [self count]];
|
||||
|
||||
while ((object = [e nextObject]) != nil)
|
||||
{
|
||||
id result = [object valueForKey: key];
|
||||
|
||||
if (result == nil)
|
||||
continue;
|
||||
|
||||
[results addObject: result];
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
- (id) valueForKeyPath: (NSString*)path
|
||||
{
|
||||
id result = (id) nil;
|
||||
|
|
Loading…
Reference in a new issue