views:

25

answers:

1

I am using sectionIndexTitlesForTableView to display index in a UITableView. It is working fine but I am using the same TableView to display something where I do not need this index. So, the question is how to remove the sectionIndex?

A: 

Use a BOOL value to track which display you are using (the first or the second) and do something like this (isDisplayingFirst is a boolean):

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
   if (isDisplayingFirst) {
      // return your section index titles
   } 
   return nil; // otherwise return nothing
}
macatomy