SugarRecord
SugarRecord copied to clipboard
NSManagedObjects subclass with a different class name
What
I have an Entity named Transaction. I generated an NSManagedObject subclass and named it TransactionManagedObject since I already have an existing Transaction (NSObject) class.
I tried fetching data from it using:
try! context.request(TransactionManagedObject.self).filtered(with: "id", equalTo: id).fetch()
However, I am getting the following error:
caught "NSInternalInconsistencyException", "NSFetchRequest could not locate an NSEntityDescription for entity name 'TransactionManagedObject'"
It works fine with managed object classes with the same entity name.
Context
I am using SugarRecord 3.0.0 in Swift3 with CoreData
@nicolettemanas are you sure that you have initialized the storage with the Core Data model where the TransactionManagedObject
is? It looks like Core Data is trying to find the entity but it's not defined in the data model that you passed during the setup.