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:
qmathe 2014-01-20 17:45:23 +00:00
parent f1b7c46f50
commit 7e1b8d8197
2 changed files with 23 additions and 0 deletions

View file

@ -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:

View file

@ -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;