博客> iOS,NSPredicate筛选NsmutableArray,
iOS,NSPredicate筛选NsmutableArray,
2019-02-17 14:21 评论:0 阅读:703 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 回到顶部