在对象数组中做一个谓词过滤。
数组中的对象有两个属性:displayValue 和 value。我试着用搜索字符串过滤,然后崩溃了。
NSPredicate *pred = [NSPredicate predicateWithFormat:@"displayValue CONTAINS[cd] %@", searchString];
NSArray *results = [_data filteredArrayUsingPredicate:pred];
报的错误是:Can't use in/contains operator with collection 100 (not a collection)