I have days and tasks. A day has many tasks. Every task has an attribute called \"points\" and I want to sum all points of the tasks of the current day. I used the code below (f
This solves my problem:
let sumRequest: NSFetchRequest<NSFetchRequestResult> = Day.fetchRequest()
Instead of putting Day
as NSFetchRequestResult
, I put NSFetchRequestResult
itself there. Now it's working.
I believe as I set it to a different resultType
it's not [Day]
anymore that gets returned, so that's why I needed to change that to be more generic or something.