这里我的代码:需要删除我的警告。我在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
}
但严重的是,我不知道如何实现这一点。如果任何人帮我提供代码说明将有助于我了解进一步的行动。谢谢@@