CoreData: group by a property, then choose one object from each group
I have a Message: NSManagedObject
, it has chatID: String
and createdAt: Date
properties. I’d like to fetch one most recent message from each chat. Is there a way to do that with a single NSFetchRequest
? Thanks!