views:

56

answers:

1

I have a UISearchBar. I enabled the 'cancel' button so it says cancel right next to the search box how can i set that button to simply lower the keyboard when the user presses it?

+2  A: 

For this there's one delegate method called when cancel button is pressed

-(void)searchBarCancelButtonClicked:(UISearchBar *) searchBar
 {
      [searchBar resignFirstResponder];
 }

-Happy Coding....

Suriya