I have a NSPredicate
to use searching Core Data
:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"objID == %@ AND createDate >= %@ AND createDate <= %@",self.objID, self.fromDate, self.toDate];
I want to expand this predicate to include the date range or if the "createDate" is nil. I'm not that familiar with SQL type searches.
Basiclly, I want to find all Core Data
entities with objID and within the date range or nil.
if (objID == X && ((dateRange >= fromDate && dateRange <= toDate) || dateRange == nil))
How can I do it?