- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex:section];
if ([tempArray containsObject: [sectionInfo indexTitle]])
{
[tempArray removeObjectAtIndex:[tempArray indexOfObject:[sectionInfo indexTitle]]];
return nil;
}else
{
[tempArray addObject: [sectionInfo indexTitle]];
return [sectionInfo indexTitle];
}
return [sectionInfo indexTitle];
}
The code above groups the cells in alphabetical order but displays a blank gray header instead of the appropriate title. Could this possibly be because I did not specify the number of headers? This would naturally be a single header for every letter in the alphabet. Any other ideas why the cell headers would flicker white to gray, gray to white as I scrolled?