When I call the function CacheStation I get the error: CoreData: error: Failed to call designated initializer on NSManagedObject class SaveModel. Nothing more nothing less. How
Here's what happens:
let sm = SaveModel();
you are creating a new instance of SaveModel
.SaveModel
is a subclass of NSManagedObject
NSManagedObject
has a designated initializer called init(_: insertIntoManagedObjectContext:)
You need to either call the NSManagedObject
designated initializer or create your own designated initializer that calls the superclass designated initializer.