I have many NSManagedObjects people that I need to filter, and was hoping to do this in the original selection, instead of filtering the array later. I used to use selectors in predicates, but never getting NSManagedObjects, for example, I have all my employees, and then I use this predicate for NSArray ...
[NSPredicate predicateWithFormat:@"SELF isKindOfClass:%@", [Boss class]]
... but now I want to do a little more math based on the different attributes of my objects. I thought I could do something like ...
[NSPredicate predicateWithFormat:@"SELF bonusIsAffordable:%f", howMuchMoneyTheCompanyHas];
.. where is bonusIsAffordable: the method of my class is Employee and will calculate if I can afford to pay them a bonus. But I get an error message ...
Unknown/unsupported comparison predicate operator type cocoa
Any ideas what I'm screwing up?
objective-c iphone cocoa core-data nspredicate
rob5408
source share