title: iOS7 searchDisplayController hides tableview indexes
body: <p>Have a tableview with indexes. They are visible on initial load. </p>
  
  <p>I also have a searchDisplayController</p>
  
  <p>When I use the searchDisplayController and then cancel out of it, suddenly the indexes on the original tableview are hidden. </p>
  
  <p>I never had this problem with iOS 6.</p>
  
  <p>Here is my code that worked with iOS 6:</p>
  
  <pre><code>- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView2 {
  
   if (self.searchDisplayController.active)
      return nil;
  
  else
      return self.indices;
  }
  </code></pre>
  
  <p>I've tried this with no luck:</p>
  
  <pre><code>- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller {
      [self.tableViewOriginal reloadSectionIndexTitles];
  }
  
  - (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller {
      [self.tableViewOriginal reloadSectionIndexTitles];
  }
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>To add the tableView I use a storyboard and connect it with an IBOutlet. The searchBar and searchDisplayController are added programmatically in viewDidLoad:</p>
  
  <pre><code>  self.searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 290, 44)]; 
    self.searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:self.searchBar contentsController:self];
  </code></pre>
  
  <p>I then add the searchbar to a table cell if cellForRowAtIndexPath</p>
  
  <pre><code> [cell addSubview:self.searchBar];
  </code></pre>