Date comparison in coredata fetch request?

core-data, ios

Solution

You can set a predicate like this in your fetch request:

[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"endDate < %@", [NSDate date]]];

Problem

In my application I am using coredata.One endDate field of type NSDate is there in my 'Job'table. I want to get all records from 'Job' having endDate less than the current date ? Any help will be appreciable

Original source