Let's say I have two entities:

Each message belongs to one MessageThread. How to get all message flows and the corresponding last message in this thread? Typically, in SQL, I would do it like:
select __ from the message group by stream having timeStamp = max (timeStamp)
First, I donβt think Core Data allows @max in its predicates. Any ideas?
source share