For example:
There is a NSDateComponents *dueDate (Transformable) property of Task * entity. And there is intend of fetching all objects that have NSDate * value of dueDate less than [NSDate date]. NSDateComponents object is created of calendar units constant NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit.
[NSPredicate predicateWithFormat:@"dueDate < %@", [NSDate date]] is type mismatch. How to create NSDate object from dueDate before equation?
Or is there a better way to compare NSDateComponents?
I think I found the best solution.
Firstly i wrote a category:
Then i hope I can use <,>,== in predicate format. So I made
NSDateComponents *from current date (which is also better for me) and my predicate looks like:I was wondering if this could work because of Transformable type of
dueDatein Core Data but it seems it works perfectly fine.