0
J'ai essayé pendant des heures mais je n'arrivais pas à comprendre pourquoi le résultat ne s'affichait pas. Il montre toujours tous les résultats. Je ne suis pas sûr de ce que je fais mal.shouldReloadTableForSearchString n'affiche pas le résultat filtré
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString scope:
[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
// Return YES to cause the search result table view to be reloaded.
return YES;
}
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
/*
Update the filtered array based on the search text and scope.
*/
[self.filteredListContent removeAllObjects]; // First clear the filtered array.
//for loop here
NSLog(@"%i", [filteredListContent count]);
//filteredListContent contains correct number of filtered items
}