– sortedArrayHint
– sortedArrayUsingFunction:context:
– sortedArrayUsingFunction:context:hint:
– sortedArrayUsingDescriptors:
– sortedArrayUsingSelector:
– sortedArrayUsingComparator:
– sortedArrayWithOptions:usingComparator:
A selector that identifies the method to use to compare two elements at a time. The method should returnNSOrderedAscending if the receiving array is smaller than the argument, NSOrderedDescending if the receiving array is larger than the argument, and NSOrderedSame if they are equal.
NSOrderedAscending
NSOrderedDescending
NSOrderedSame
//selector定义了一个比较两个数组元素的方法,如果此方法返回NSOrderedAscending说明此元素比参数元素小,如果返回NSOrderedDescending说明接收的数组元素比参数元素大,NSOrderedSame相等。
NSOrderedAscending说明此元素比参数元素小,如果返回NSOrderedDescending说明接收的数组元素比参数元素大,NSOrderedSame相等。
NSOrderedDescending说明接收的数组元素比参数元素大,NSOrderedSame相等。
NSArray *sortedArray =
[anArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
posted on 2012-04-05 17:09 Wangkeke 阅读(1069) 评论(0) 编辑 收藏 引用 所属分类: IOS
Powered by: C++博客 Copyright © Wangkeke