title: UISearchDisplayContoller – can't prevent table reload on typing in search bar
body: <p>I'm trying to set up a search display controller to handle async results from a web service. I've got the basic bits in place but have run into a really strange issue that I can't figure out. </p>
  
  <p>Seems like to rig up the search display controller for async you really just need to do two things:</p>
  
  <ol>
  <li>return NO for
  searchDisplayController:shouldReloadTableForSearchString,
  and</li>
  <li>handle searchBarSearchButtonClicked
  and fire off the table reload
  myself.</li>
  </ol>
  
  <p>I'm doing both of these but what I'm seeing is that the search display controller is reloading the table on the first character typed into the search bar even though I'm returning NO as per #1. It doesn't reload on subsequent characters entered. </p>
  
  <p><strong>So, my question is: how do I keep the search display controller from trying to reload the table while the user is typing? (specifically on that first character entered)</strong></p>
  
  <p>I've seen this issue mentioned as part of a couple of other questions but I have not seen a direct answer to the problem. I'd like to understand what's going on or what I'm doing wrong before I resort to a bunch of UI mangling to work around it. </p>
  
  <p>Here's a quick distillation of my code to show the issue. When I run this and type "abcde" into the search bar, after I type "a" the results display as "a #0", "a #2", etc. They don't update again until I hit the search button then you see "abcde #0", "abcde #1", etc. Desired result is, of course, nothing happens until I hit the search button.</p>
  
  <pre><code>#pragma mark -
  #pragma mark UISearchDisplayController Delegate Methods
  
  - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString {
      return NO;
  }
  
  - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption {
      return NO;
  }
  
  
  #pragma mark -
  #pragma mark UISearchBarDelegate Methods
  
  - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
      [self.searchDisplayController.searchResultsTableView reloadData];
  
  }
  
  
  #pragma mark -
  #pragma mark Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      return 20;
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
      static NSString *CellIdentifier = @"Cell";    
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
      }
      cell.textLabel.text = [self.searchDisplayController.searchBar.text stringByAppendingFormat:@" #%d", indexPath.row]; 
      return cell;
  }
  </code></pre>
  
  <p>Thanks! (btw, this is my first question asked here—please let me know if I miss any points of etiquette :)</p>