我正在以这种方式过滤数组,以便为我的表视图提供内容:
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"SELF contains[c] %@", searchText];
filteredTableData = [[allFileNames filteredArrayUsingPredicate:resultPredicate] mutableCopy];
}
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString
scope:[[self.searchDisplayController.searchBar scopeButtonTitles]
objectAtIndex:[self.searchDisplayController.searchBar
selectedScopeButtonIndex]]];
return YES;
}
当我更改搜索栏中的文本时,搜索完成,我看到弹出类似名称的单元格。但是,cell.imageview.image似乎没有改变。我在搜索之前的图像中得到了正确的标题标签...为什么会发生这种情况?