mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Added missing Mac OS X 10.6 methods related to NSSortDescriptor
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37689 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
95b7ba8812
commit
bb9c1ea364
3 changed files with 63 additions and 0 deletions
|
@ -121,6 +121,20 @@ static BOOL initialized = NO;
|
|||
return _ascending + GSPrivateHash(0, sel, strlen(sel)) + [_key hash];
|
||||
}
|
||||
|
||||
+ (id) sortDescriptorWithKey: (NSString *)aKey ascending: (BOOL)ascending
|
||||
{
|
||||
return AUTORELEASE([[self alloc] initWithKey: aKey ascending: ascending]);
|
||||
}
|
||||
|
||||
+ (id) sortDescriptorWithKey: (NSString *)aKey
|
||||
ascending: (BOOL)ascending
|
||||
selector: (SEL)aSelector
|
||||
{
|
||||
return AUTORELEASE([[self alloc] initWithKey: aKey
|
||||
ascending: ascending
|
||||
selector: aSelector]);
|
||||
}
|
||||
|
||||
- (id) initWithKey: (NSString *) key ascending: (BOOL) ascending
|
||||
{
|
||||
return [self initWithKey: key ascending: ascending selector: NULL];
|
||||
|
@ -449,3 +463,13 @@ SortRange(id *objects, NSRange range, id *descriptors,
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSSet (NSSortDescriptorSorting)
|
||||
|
||||
- (NSArray *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors
|
||||
{
|
||||
return [[self allObjects] sortedArrayUsingDescriptors: sortDescriptors];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue