Up
Authors
- Generated by Gregory John Casamento,,,
-
Date: Generated at 2023-12-20 19:35:39 -0500
- Declared in:
- Foundation/NSSortDescriptor.h
- Conforms to:
- NSCopying
- NSCoding
Availability: MacOS-X 10.3.0
Instances of this class are used to perform
multi-level sorts of arrays containging
collections or other objects whose properties can
be obtained using key names.
Method summary
+ (id)
sortDescriptorWithKey: (
NSString*)aKey
ascending: (BOOL)ascending;
Availability: MacOS-X 10.6.0
Returns an autoreleased sort descriptor for
comparisons using the 'compare:' selector and
the specified key and ordering.
See also
-initWithKey:ascending:
.
+ (id)
sortDescriptorWithKey: (
NSString*)key
ascending: (BOOL)ascending
comparator: (NSComparator)cmptr;
Availability: MacOS-X 10.6.0
Returns an autoreleased sort descriptor
initialized to perform comparisons in the
specified order using the comparator to compare
the property aKey of each object.
See also
-initWithKey:ascending:selector:
.
+ (id)
sortDescriptorWithKey: (
NSString*)aKey
ascending: (BOOL)ascending
selector: (SEL)aSelector;
Availability: MacOS-X 10.6.0
Returns an autoreleased sort descriptor
initialized to perform comparisons in the
specified order using aSelector to
compare the property aKey of each
object.
See also
-initWithKey:ascending:selector:
.
- (BOOL)
ascending;
Availability: MacOS-X 10.3.0
Returns a flag indicating whether the sort
descriptor sorts objects in ascending order (
YES
) or descending order (
NO
).
- (
NSComparisonResult)
compareObject: (id)object1
toObject: (id)object2;
Availability: MacOS-X 10.3.0
Returns the result of comparing object1
to object2 using the property whose key is
defined in the receiver and using the selector of
the receiver. If the receiver performs a descending
order sort, the result of this comparison is the
opposite of that prroduced by applying the
selector.
- (id)
initWithKey: (
NSString*)key
ascending: (BOOL)ascending;
Availability: MacOS-X 10.3.0
Initialises the receiver for comparisons using
the 'compare:' selector and the specified
key and ordering.
- (id)
initWithKey: (
NSString*)key
ascending: (BOOL)ascending
comparator: (NSComparator)cmptr;
Availability: MacOS-X 10.6.0
This is a designated initialiser for the class.
Initialises the receiver to perform comparisons
in the specified order using the comparator to compare
the property key of each object.
- (id)
initWithKey: (
NSString*)key
ascending: (BOOL)ascending
selector: (SEL)selector;
Availability: MacOS-X 10.3.0
This is a designated initialiser for the class.
Initialises the receiver to perform comparisons
in the specified order using selector to
compare the property key of each object.
- (
NSString*)
key;
Availability: MacOS-X 10.3.0
Returns the key used to obtain the property on
which comparisons are based.
- (id)
reversedSortDescriptor;
Availability: MacOS-X 10.3.0
Returns a copy of the receiver which compares and
sorts in reversed order.
- (SEL)
selector;
Availability: MacOS-X 10.3.0
Returns the selector used to compare the properties
of objects.
- Declared in:
- Foundation/NSSortDescriptor.h
Availability: MacOS-X 10.3.0
Description forthcoming.
Method summary
- (GS_GENERIC_CLASS(NSArray,ElementT)*)
sortedArrayUsingDescriptors: (
NSArray*)sortDescriptors;
Availability: MacOS-X 10.3.0
- Declared in:
- Foundation/NSSortDescriptor.h
Availability: MacOS-X 10.3.0
Description forthcoming.
Method summary
- (void)
sortUsingDescriptors: (
NSArray*)sortDescriptors;
Availability: MacOS-X 10.3.0
This method works like this: first, it sorts the
entire contents of the array using the first sort
descriptor. Then, after each sort-run, it looks
whether there are sort descriptors left to process,
and if yes, looks at the partially sorted array, finds
all portions in it which are equal (evaluate to
NSOrderedSame) and applies the following
descriptor onto them. It repeats this either
until all descriptors have been applied or there are
no more equal portions (equality ranges) left in the
array.
- Declared in:
- Foundation/NSSortDescriptor.h
Availability: MacOS-X 10.6.0
Description forthcoming.
Method summary
- (GS_GENERIC_CLASS(NSArray,ElementT)*)
sortedArrayUsingDescriptors: (
NSArray*)sortDescriptors;
Availability: MacOS-X 10.6.0
Up