I'm pretty new to NSPredicate, and sorry if this is newbie question, but I'v done my research and couldn't find answer to this.
I would like to filter array of custom objects by their function, not property.
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ LIKE %@", [times objectAtIndex:x] ,[unit realTime]];
NSArray *filtered = [objectArray filteredArrayUsingPredicate:predicate];
the objectArray contains only unit Objects. And i would like to filter the array by each object in Array by [unit realTime] method result. Basically I'd like to have filtered array where [times objectAtIndex:x] == [unit realTime]. Is this possible to do?
[NSPredicate predicateWithFormat:@"%K LIKE %@", unit.realTime, [times objectAtIndex:x]];realTimeas an@property(readonly) inunitand then implementrealTimemethod. Is that possible?realTimeas an@property() NSDate *realTime;in Unit.h file and then implementrealTimemethod just like how you have already done. That wayrealTimeis a param in class and you are overriding the getter method with your custom implementation. It shouldnt show anundeclared identifiererror in this case.