Если вы хотите, чтобы буквы AZ находились сбоку (даже если у вас нет разделов для каждой буквы), это будет сделано:
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return [NSArray arrayWithObjects:@"A",@"B",@"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",@"U",@"V",@"W",@"X",@"Y",@"Z",@"#",nil];
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
index = 0;
for(id sectionInfo in [_fetchedResultsController sections]){
if ([[[sectionInfo name] uppercaseString] isEqualToString:title]){
break;
}
index++;
}
if (index>=[_fetchedResultsController sections].count){
return -1;
}
return [_fetchedResultsController sectionForSectionIndexTitle:title atIndex:index];
}