【发布时间】:2017-10-03 19:12:59
【问题描述】:
我使用了这种方法,但它说它已被弃用。我应该使用哪种方法来代替这种方法?
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];
return YES;
}
【问题讨论】:
-
究竟什么方法被弃用了?您是否阅读了每个文档的文档?可能有关于使用什么方法的指示。另外,这些标签是什么?
-
-(BOOL)searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{ return YES; }
-
阅读
UISearchDisplayDelegate的文档:Important: UISearchDisplayDelegate is deprecated in iOS 8. (Note that UISearchDisplayController is also deprecated.) To manage the presentation of a search bar and display search results in iOS 8 and later, instead use UISearchControllerDelegate.
标签: ios objective-c ios7 io ios5