–?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 閱讀(1083) 評論(0) 編輯 收藏 引用 所屬分類: IOS
Powered by: C++博客 Copyright © Wangkeke