博客> iOS,NSPredicate筛选NsmutableArray,
iOS,NSPredicate筛选NsmutableArray,
2017-12-12 11:41 评论:0 阅读:373 yutaotst
ios NSMutableArray 筛选 NSPredicate筛选

iOS,NSPredicate筛选NsmutableArray,

 NSString *filterString = searchController.searchBar.text;

    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self.name  contains [c] %@", filterString];

    self.searchArray = [NSMutableArray arrayWithArray:[self.dataArray filteredArrayUsingPredicate:predicate]];
收藏
1
sina weixin mail 回到顶部