【发布时间】:2014-09-13 18:29:32
【问题描述】:
您如何更正以下内容以使不出现警告? 我错过了什么?
将searchResultsController 更正为searchController 时,出现错误“找不到对象”
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;
}
【问题讨论】:
-
那可能是什么?请参阅上面编辑过的帖子...
-
没有。您可以根据需要添加自己的 ivar 或属性来跟踪它。
-
你在开玩笑吧?为什么我必须这样做才能完成一个一直免费提供的简单任务?苹果在想什么?
标签: ios uisearchdisplaycontroller