I have an entity called “Sessions” and it contains an NSDate attribute.
What I want is to be able to query the core data model and get an array of the DAYS of the NSDates, without any duplicates.
For example, if I have 5 sessions on thursday, 2 on friday and 1 on sunday, I want an array of “Thursday”, “Friday”, “Sunday”.
(It doesn’t necessarily have to have that string format, that part I can figure out and modify myself.)
What would be the proper way to approach this method?
You cannot. This is not what
NSPredicateis for. You’ll have to fetch theSessionobjects, and for each one, figure out what day it’s on. It’ll be something like this:Note that since we’re using an
NSSet, the days of the week will be unordered.