How do you correct the following so no warnings appear? What am I missing?
When correcting the searchResultsController
to searchController
it gives me an error "object not found"
if (tableView == self.searchDisplayController.searchResultsTableView) {
cell.textLabel.text = [searchResults objectAtIndex:indexPath.row];
} else {
cell.textLabel.text = [_content objectAtIndex:indexPath.row];
}
return cell;
}
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller
shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString
scope:[[self.searchDisplayController.searchBar scopeButtonTitles]
objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
return YES;
}
The
UISearchController
class replaces theUISearchDisplayController
class for managing the display of search-related interfaces.
Source : https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html
So, as rmaddy said, if you want to get rid of the deprecated warnings, stop using the deprecated classes. Use UISearchController
instead: