title: UISearchBar's Cancel and Clear Buttons Not Working in iOS 7
body: <p>I have an xCode project that contains a tableview with a “Search Bar and Search Display Controller” to allow the user to refine the list of displayed items.  In general, the guidance provided in <a href="http://www.raywenderlich.com/16873/how-to-add-search-into-a-table-view">http://www.raywenderlich.com/16873/how-to-add-search-into-a-table-view</a> was followed.  I recently downloaded the latest xCode (Version 5.0 (5A1413)) with iOS 7 support and have been testing the app in question on different targets.</p>
  
  <p>When running this app on an iOS 6 target (emulator or real device), it works as expected meaning that pressing the cancel button removes the search bar and pressing the clear button (little gray x) clears all of the search criteria already typed in by the user.  But when the project is run on an iOS 7 target both the clear and cancel button do not work.   </p>
  
  <p>The searchBarCancelButtonClicked method is implemented in this project, and I have verified that it is not called when the target is running iOS 7.</p>
  
  <pre><code>- (void)searchBarCancelButtonClicked:(UISearchBar *)SearchBar
  {
      NSLog(@"searchBarCancelButtonClicked called");
  
      self.searchBar.text = nil;
  
      …
  
      // Hide Search bar when cancelled
      [self hideSeachBar];
  
      [self.searchBar resignFirstResponder];
  
      …
      }
  </code></pre>
  
  <p>My table view controller is setup to be the UISearchDisplayDelegate and UISearchBarDelegate.  And it appears that this is still working as searchBar:textDidChange: is called on either a iOS 6 or 7 target.</p>
  
  <pre><code>@interface ItemViewController () &lt;UISearchDisplayDelegate, UISearchBarDelegate&gt;
  …
  @end
  </code></pre>
  
  <p>I cannot see any other posts related to this or any iOS 7 change material (like <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html#//apple_ref/doc/uid/TP40013174-CH8-SW1">https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html#//apple_ref/doc/uid/TP40013174-CH8-SW1</a>)  that mentions any recoding that needs to be done to support iOS7.</p>
  
  <p>Any thoughts on this?  Thanks</p>