When I run the app, after pressing the Add Example button, the app crashes with:
Thread 1: "An NSManagedObject of class 'Ship' must have a valid NSEntityDescription."
I initially after Day 57, deleted the wizard entity and the and the other one as each of the lessons seemed to have you create a new entity (even though there one was already). So i thought ok, something is correct, I did a clean build folder... that didnt help...deleted the app on the simulator, that didnt help... closed Xcode and the simulator and that didnt help. So I deleted the entire CoreDataProjectApp and made a new one...
I still have the issue....
I also made sure the NSPersistentContainer name matches the name of my CoreDataProject.xcdatamodeid
what am I missing?
import CoreData
import Foundation
class DataController: ObservableObject {
let container = NSPersistentContainer(name: "CoreDataProject")
init() {
container.loadPersistentStores { description, error in
if let error = error {
print("Core Data failed to load: \(error.localizedDescription)")
}
}
}
}