Reputation: 5169
I have entities prefixed with ICD_ in my Core Data Model. For each entity, I have a subclass which is prefixed with CD_. The subclasses which are prefixed with CD_ only implement static getters.
When I create an entity with MagicalRecord, I have to use the class prefixed with ICD_ not with CD_. Otherwise, I've got a SIGABRT:
"+entityForName: could not locate an entity named 'CD_User' in this model."
If I downcast my ICD_ entity to my CD_Entity it works in Objective-C. The same thing in Swift causes a SIGABRT. It's quite naturally because, it's the parent entity which is allocated, not the child class, so it's normally impossible to downcast it.
So I'm looking for a solution which permits to use my subclasses prefixed with CD_ with MagicalRecord.
Upvotes: 3
Views: 617
Reputation: 69757
Either your data model is not loaded properly, or you are using an incorrect name to access the entities. You can see what names your data model contains by using the -entitiesByName method on NSManagedObjectModel
Upvotes: 0