1
全部,为sectionIndexTitlesForTableView正确设置索引
我在我的tableview中添加了段索引(索引),它工作正常。点击“K”,然后转到“K”部分。我现在试图通过把它放到我的索引数组中来将分割图放到分区索引中,当然,分区索引不会干净地映射到分区上,因为索引现在已经关闭了。 “A”曾经是索引0,现在放大镜在索引0处,所以现在全部关闭一个索引。你点击“J”并获得“K”等。有人可以向我解释添加放大镜的最佳方法吗?由于
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
NSMutableArray *indices = [NSMutableArray array];
//Add the magnifying glass as the first element in the indices array
[indices addObject:UITableViewIndexSearch];
for(int i = 0; i<sorted.count; i++){
[indices addObject:[sorted objectAtIndex:i]];
}
return indices;
}