Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSManagedObjects subclass with a different class name #321

Open
nicolettemanas opened this issue Feb 27, 2017 · 1 comment
Open

NSManagedObjects subclass with a different class name #321

nicolettemanas opened this issue Feb 27, 2017 · 1 comment

Comments

@nicolettemanas
Copy link

nicolettemanas commented Feb 27, 2017

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

@pepicrft
Copy link

pepicrft commented Apr 7, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants