Why will @FetchRequest work on one view but not the other

23 Views Asked by At

I have 2 views in my SwiftUI project - I have two entities in CoreData one called Labour the other, Materials. I have this

@FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \Labour.from, ascending: true)]) var weeks: FetchedResults<Labour>

in the Labour view but if I repeat this code in the Materials view and change the entity name and what it should sort on I get this error

"Generic parameter 'Root' could not be inferred".

I cant figure out why one would work and the other will not.

0

There are 0 best solutions below