searchDisplayController'已被弃用:首先在iOS 8.0中不推荐使用
在这里我的代码:需要删除我的警告。 我在iOS 9下
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ if (searchText.length>0) { self.searchBarActive = YES; [self filterContentForSearchText:searchText scope:[[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]]; [self.collectionView reloadData]; }else{ // if text lenght == 0 // we will consider the searchbar is not active self.searchBarActive = NO; } }
需要删除我的警告,因为我提到我的问题。它应该与iOS 7上面的工作。我是新来的ios。 但是需要删除我的警告信息。我已经尝试了下面的代码:
if([UISearchController class]){ //Create an UISearchController and add it to your UITableViewController }else{ //Create an UISearchDisplayController and add it to your UITableViewController }
但严重的是我不知道该怎么实现。如果任何人帮我用代码解释,将有助于我进一步了解进一步的行动。感谢@@
。H
@property (strong, nonatomic) UISearchController *searchController;
.M
[self filterContentForSearchText:searchText scope:[[self.searchController.searchBar scopeButtonTitles] objectAtIndex:[self.searchController.searchBar selectedScopeButtonIndex]]];
这个编码工作得很好….
- 顶部iOS上的自定义滚动标签栏
- UIActivityViewController Airdrop – 检查“已发送”或“已拒绝”时的状态
- 具有本地化应用名称的多个目标的本地化项目
- 如何从UIColor获取反色?
- UICollectionViewLayout layoutAttributesForElementsInRect和layoutAttributesForItemAtIndexPath
- 将离线地图embeddedIOS应用程序
- 如何在swift中检查设备方向是左侧还是右侧?
- 将AudioBufferList转换为CMSampleBuffer会产生意外的结果
- ACAccountStore错误6(ACErrorAccountNotFound)和8