我有一个字符串数组
NSMutableArray * nam = [[NSMutableArray alloc] initWithObjects:@"ZAZ", @"London", @"Australia",@"England", @"Dallas", @"Mexico", @"Russia", nil];
如何从这个字符串按字母顺序创建索引 TableView???就像在“联系人”中一样!或者也许有人知道这个问题的一些教训?
最佳答案
编辑:创建UITableView按照链接。使用 newArray 作为 tableview 数组
像这样按字母顺序对 NSMutableArray 进行排序:
NSMutableArray *newArray = [nam sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
将此 newArray 用作按字母顺序排列的单元格的 TableViewDataSource
数组
关于iphone - 来自字符串数组 iOS 的索引表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11881894/