I have a really annoying bug. May be there is a trivial solution, but I can't get it.
I use NSPredicate
often without any problem. Now the following bug comes: Terminating app due to uncaught exception 'NSUnknownKeyException
', reason: '[<TestClass 0x10cf3b80> valueForUndefinedKey:]: this class is not key value coding-compliant for the key testValue.
'
NSString* predicateString = [NSString stringWithFormat:@"name CONTAINS[cd] %@",@"testValue"];
NSPredicate* filterPredicate = [NSPredicate predicateWithFormat:predicateString];
NSArray* filtered = [all filteredArrayUsingPredicate:filterPredicate];
name is an NSString*
property of my class, all is an array with my objects in it. Just some trivial code, nothing extra.
Thanks for any help!