views:

125

answers:

1

Hi,

I am using search display controller and a search bar. When i click inside the serach bar the keyboard appears. When i navigate away to another page , the keyboard does not disappear and stays in the same page. Can you please help me ?

Thanks, Andy.

A: 

You're going to want to do something like [searchBar resignFirstResponder] perhaps in – (void)searchBarCancelButtonClicked: (UISearchBar *) searchBar

Alistair
Tried using [searchbar resignFirstResponder] in view will disappear and view did disappear but no use :(
Have you tried using breakpoints or NSLog statements to ensure that the call to `resignFirstResponder` is actually being made? I ask because I used to frequently forget to define `viewWillDisappear:` with its second argument, `animated:`, so it wouldn't be called. Caused me all sorts of confusion before I figured out how to debug effectively.
Endemic