0

I am wanting to compare dates in an NSPredicate when using an NSFetchRequest in Core Data. I am using:

[NSPredicate predicateWithFormat:@"SELF IN %@ AND dateFound == %@", self.set.events, filterDate];

filterDate is an NSDate object that has the time components set to 00. See: Removing time components from an NSDate object using Objective C/Cocoa

events is a relationship in Core Data, and I am needing to check the dateFound attribute of the Event object that is in that relationship, which is an NSDate object.

The issue here is that the dateFound attribute is stored in Core Data, and since I need to use a predicate with SELF IN I cannot modify the dateFound data and strip its time components.

Do I have any other options here?

Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412

0 Answers0