I have an entity matches which has a related to-many entity sets. I want to get a count of how many sets have the attribute 'set_finished' set to YES for a particular match. I'm trying to do this with:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ANY set_finished == YES"]; NSUInteger numberOfFinishedSets = [[[match valueForKeyPath:@"sets"] filteredArrayUsingPredicate:predicate ] count];
The second line crashes with this error, which I don't understand. Can anyone shed some light on this for me? Thanks.
2010-12-20 13:17:13.814 DartScorer[2154:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSFaultingMutableSet filteredArrayUsingPredicate:]: unrecognized selector sent to instance 0x617fb20'