title: Hide UISearchBar of UISearchDisplayController
body: <p>I have a tabbar based application, and <code>UInavigationcontroller</code> for every tab. In a <code>TabViewController</code>, I have implemented a <code>UIsegmentedcontrol</code>, <code>searchDisplayController</code> and uitableview. The navigationItems, tabledata are changed based on the segmentedcontrol select. And for a segment i have hidden the search bar. But when the searchbar is hidden, tableview first row does not respond to <code>didselectrowatindexpath</code>.</p>
  
  <p>Here is my code,</p>
  
  <p>In segment change action</p>
  
  <pre><code>- (void)indexDidChangeForSegmentedControl:(UISegmentedControl *)aSegmentedControl {
  [self changeNavigationItems];
  
  l.text = [NSString stringWithFormat:@"%d",self.segmentControl.selectedSegmentIndex];
  if([segmentIndexesToHideSearchBar containsObject: [NSString stringWithFormat:@"%d", self.segmentControl.selectedSegmentIndex]])
  {
      self.searchDisplayController.searchBar.hidden = YES;
      self.dataTable.frame = CGRectMake(0, 0, self.dataTable.frame.size.width, self.dataTable.frame.size.height);
  }
  else
  {
      self.searchDisplayController.searchBar.hidden = NO;
      self.dataTable.frame = CGRectMake(0, 44, self.dataTable.frame.size.width, self.dataTable.frame.size.height);
  }
  [self.dataTable reloadData];
  </code></pre>
  
  <p>}</p>
  
  <p>Other codes are generic and other things are working correct.</p>
  
  <p>Second problem is when i am getting back from a details view by clicking on a row, the change of frame of table is not kept. There is a space where searchbar was.</p>
  
  <p>Waiting for help.</p>