Context
My app uses CoreData
and for the first version I was just using the Class Definition
as the Codegen Method
for all Entities
. However, since I changed it to Category / Extension
, the app crashes every time a View
with a @FetchedResult
Property Wrapper
is loaded.
Crash Message: Thread 1: "executeFetchRequest:error: A fetch request must have an entity."
Code
// MyEntity.swift
public final class MyEntity: NSManagedObject {
// ...
}
Questions
- What causes the crash and how can I resolve it?
- Is it necessary to define a new
CoreData
Model Version
when only changing theCodegen Method
? - Is the change of the
Codegen Method
supported byLightweight Migration
?