1、self.items数组内元素为NSDictionary
plateNumber为NSDictionary中的一个key
现在要获取self.items中所有plateNumber对应的value,并返回一个数组
searchString是在搜索框内写的字段
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"plateNumber CONTAINS[cd] %@",searchString];
self.searchResults = [[self.items filteredArrayUsingPredicate:predicate] mutableCopy];
2、如果self.items中是string,获取包含searchString字符的元素
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF CONTAINS[cd] %@",searchString];
self.searchResults = [[self.items filteredArrayUsingPredicate:predicate] mutableCopy];