2

I'm trying to create a sortDescriptor for an NSArray of NSStrings.

I'm just not sure what to put for the key parameter as I want to use "self" or something equivalent as I just want to use the standard NSString compare.

In this code...

[NSSortDescriptor sortDescriptorWithKey:@"..." ascending:YES];

What should I put where the ... is? self?

4

1 回答 1

2

self应该管用。您也可以使用description,在这种情况下,排序不仅适用于 NSString,也适用于 NSNumber。

于 2013-07-30T15:14:43.717 回答