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
I have the same problem, I tried with the following code. Please try this one.
-(void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller
{
controller.active = YES;
[self.view addSubview:controller.searchBar];
[self.view bringSubviewToFront:controller.searchBar];
}
- (void)searchDisplayController:(UISearchDisplayController *)controller didShowSearchResultsTableView:(UITableView *)tableView {
tableView.frame = self.archiveListTblView.frame;
}
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller
{
controller.active=NO;
[self.view addSubview:controller.searchBar];
}