First of all, this is my first question, so be nice:).
Have any of You noticed weird behaviour math functions in NSPredicate?
My example is:
1) I have departure class with interface:
@interface OTDeparture : NSManagedObject
@property (nonatomic, retain) NSNumber * position;
@end
2) i create fetch request with predicate:
NSPredicate *predicate=[NSPredicate predicateWithFormat:@"(position-1)*(position-1) > 0"];
and the result is always zero objects (predicate is always NO). Also format "(2-1)*(2-1) > 0" and "(position-1)*position > 0" does the same thing.
These predicate formats work as expected (return object as expected):
"2*(position-1) > 0"
"2*2 > 0"
"position-3 > 0"
Am I doing something wrong, or is this really a bug? I'm not using any third party stuff, just code provided by Apple.