0

I am using searchDisplayController for search functionality. On the click of the search button, I do folowing thing:

[mySearchBar becomeFirstResponder];

First time, everything works fine. I do following in searchDisplayControllerDidEndSearch (which will be called on cancel button event)

- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller
{
  [mySearchBar resignFirstResponder];
}

Now, on cancel button press, search bar hides also. Till that moment everything works fine. Now when second time I press search icon, search bar opens and even-though I type text and get search results, the dim view stays there.

I don’t know the problem is.

halfer
  • 19,824
  • 17
  • 99
  • 186
NSPratik
  • 4,714
  • 7
  • 51
  • 81

1 Answers1

0

I solved it !!!

Actually I was making a tiny mistake in order to hide/show the Tableview of search display controller as following:

-(IBAction)searchButton_Action:(id)sender
{
    //
    //
    self.searchDisplayController.searchResultsTableView.hidden = FALSE;
    //
    //
}

We should not do this on our own programatically because searchDisplayController itself manages its TableView.

NSPratik
  • 4,714
  • 7
  • 51
  • 81