0
如何按字母顺序显示UITableView,类似于iPod.app对各节和sectionIndex所做的操作。我在Apple文档中搜索没有成功。有什么建议么?按字母顺序显示UITableView NSArray
如何按字母顺序显示UITableView,类似于iPod.app对各节和sectionIndex所做的操作。我在Apple文档中搜索没有成功。有什么建议么?按字母顺序显示UITableView NSArray
NSArray *myArray = [NSArray arrayWithObject:@"me", @"you", @"her", nil];
[myArray sortedArrayByPerformingSelector:@selector(compare:)];
如果只想按字母顺序排序字符串数组,可以通过实现它:
sortedArray = [originalArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare :)];