title: How to enable cancel button with UISearchBar?
body: <p>In the contacts app on the iPhone if you enter a search term, then tap the "Search" button, the keyboard is hidden, BUT the cancel button is still enabled.  In my app the cancel button gets disabled when I call resignFirstResponder.</p>
  
  <p>Anyone know how to hide the keyboard while maintaining the cancel button in an enabled state?</p>
  
  <p>I use the following code:</p>
  
  <pre><code>- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
  {
      [searchBar resignFirstResponder];
  }
  </code></pre>
  
  <p>The keyboard slides out of view, but the "Cancel" button to the right of the search text field is disabled, so that I cannot cancel the search.  The contacts app maintains the cancel button in an enabled state.</p>
  
  <p>I think maybe one solution is to dive into the searchBar object and call resignFirstResponder on the actual text field, rather than the search bar itself.</p>
  
  <p>Any input appreciated.</p>