2011-07-25 66 views

回答

0
NSArray *myArray = [NSArray arrayWithObject:@"me", @"you", @"her", nil]; 

[myArray sortedArrayByPerformingSelector:@selector(compare:)]; 
1

如果只想按字母顺序排序字符串数组,可以通过实现它:

sortedArray = [originalArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare :)];