+ sortDescriptorWithKey:ascending:
- initWithKey:ascending:
- initWithKey:ascending:selector:
+ sortDescriptorWithKey:ascending:comparator:
- initWithKey:ascending:comparator:
- initWithCoder:
Availability 有効性
Technology
+ (instancetype)sortDescriptorWithKey:(NSString
*)key
ascending:(BOOL)ascending
selector:(SEL)selector;
key
The key path for performing a comparison.
For information about key paths, see Key-Value Coding Programming Guide. キーパスについての情報として、Key-Value Coding Programming Guideを見てください。
ascending
YES
if the receiver specifies sorting in ascending order; otherwise, NO
.
selector
The method to use when comparing the properties of objects, for example localized
. The selector must specify a method implemented by the value of the property identified by the key path.
それらオブジェクトのプロパティを比較しているときに使うメソッド、例えばlocalized
。セレクタは、キーパスによって識別されるプロパティの値によって実装されるメソッドを指定しなければなりません。
The selector used for the comparison is passed a single parameter, the object to compare against, and it returns the appropriate NSComparison
constant.
A sort descriptor that initializes with the specified key path, sort order, and comparison selector.
+ sortDescriptorWithKey:ascending:
- initWithKey:ascending:
- initWithKey:ascending:selector:
+ sortDescriptorWithKey:ascending:comparator:
- initWithKey:ascending:comparator:
- initWithCoder: