How do we fetch unique Calendar Dates for Core Data Objects?
For example: If we have three emotion objects with NSDates:
"2014-08-04 20:33:42 +0000",
"2014-08-04 20:50:33 +0000",
"2014-08-04 20:50:46 +0000",
"2014-08-06 20:35:58 +0000",
"2014-08-08 20:33:49 +0000"
I want to get an array of NSDates that looks like this:
2014-08-04
2014-08-06
2014-08-08
I have explored these threads as possible solutions but neither of them work.
A possibility would be to make time and date attributes for the managed objects I am searching for but that seems like a clunky work around.
Another possibility is to strip the time component of the all the NSDates that come back then filter the array of Dates again for duplicates. Again this seems really clunky and prone to breaking.
I want to get an array of NSDates with only the calendar date and then use that information to present tableview cells. When the user taps a given tableView cell I can push a viewController that displays data related to that calendar date. As time goes on the number of NSDates could get large because there will be many objects with NSDates to search for so the solution should be efficient.