我正在尝试对一组对象进行简单的谓词过滤。
数组中的对象有 2 个属性,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)
这种导致崩溃的格式到底有什么不正确的地方?