I'm new to developing for the iPhone and I'm using Core Data for my data management. My managed objects have a property called creationDate and I need to have a list of all distinct dates that are in the database. To reduce the overhead I set
[fetchRequest setPropertiesToFetch:[NSArray arrayWithObject:@"creationDate"]];
because that's all that's needed.
I know I can set [fetchRequest setReturnsDistinctResults:YES]; to get the distinct dates, but how can I take only the date part of an NSDate in a fetch request?
thanks,
Thomas
P.S. In SQL this would look something like: SELECT DISTINCT DATE(creationDate) FROM events;