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

Could not locate the entity for \(className) even though it exists #90

Open
mariusschoenefeld opened this issue Jun 5, 2018 · 5 comments

Comments

@mariusschoenefeld
Copy link

I installed Groot via cocoapods and using xcode 9.3, swift 4.

When I Call:

let context = NSManagedObjectContext.mr_default()
let _: [MObject] = try objects(fromJSONArray: correctedJSON, inContext: context)

It throws the fatalError I can't explain to my self why. this object exists. Any ideas?

@gonzalezreal
Copy link
Owner

Hi @mariusschoenefeld. Is there any message with the fatalError? Without more context, I can only guess that MObject does not have a corresponding entity in the Core Data model.

@pablogeek
Copy link

it is happening the same to me. When we get the let className = String(reflecting: self) the class name has Module.Entity and the entities only shows Entity

@billsea
Copy link

billsea commented Oct 10, 2018

Yes, I'm experiencing the same issue at: let className = String(reflecting: self)

@vincilbishop
Copy link

vincilbishop commented Dec 9, 2018

Yeah, it's a real issue...see this PR: #94

@gonzalezreal
Copy link
Owner

Hi all,

Please make sure that the module of the class is properly identified in the model:

screenshot 2018-12-12 at 09 23 27

In this example, taken from Groot unit tests, the model and the class are in the same module. If your case is different, you will need to be explicit about the module in which the class is implemented.

In case you don't control the model (ie. it is in a Cocoapod like specified in #94) you will need to discuss it with the author of that model.

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

5 participants