我注意到 UISearchDisplayDelegate 中基本上所有内容已弃用。这是我被教导实现搜索栏和搜索显示 Controller 的唯一方法,什么是好的解决方法?
示例代码为:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (tableView == self.searchDisplayController.searchResultsTableView) { // 'searchDisplayContoller' is now deprecated
return [searchList count];
} else {
return [initialList count];
}
}
最佳答案
UISearchController
应该替换它...
Apple 关于替换的注释,滚动到 UIKit Framework 部分: https://developer.apple.com/library/prerelease/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS8.html
关于ios - UISearchDisplayDelegate 弃用解决方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24910350/