Iphone – Strange issue with Indexed UITableView’s section index title is incorrect

cocoa-touchiphoneuikit

I ran into a strange issue with my indexed tableview's section index titles. The index titles returned is correct (A – Z) as outputted by the debugging code below but the displayed index titles on the right side of the table is separated with • instead. So instead of A B C D… I get A • C • E •… instead.

Any idea what's causing this? I have another tableview in my app but that tableview doesn't suffer from this problem but I haven't figured out why yet.

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {

 NSMutableArray *sectionTitles = [[[NSMutableArray alloc] init] autorelease];
 [sectionTitles addObject:UITableViewIndexSearch];
 [sectionTitles addObjectsFromArray:[self.fetchedResultsController sectionIndexTitles]];

        // NSArray *debug = [self.fetchedResultsController sectionIndexTitles];
        // CFShow(debug);
 return sectionTitles;
}

Best Answer

This is caused when the height available to display the index is less than what is needed to display each letter. The index is abbreviated (or shrunk). This effect will also occur when the keyboard is displayed and the index is still visible.

Related Topic