0
votes

I have a Core Data data model where I have two similar, but not same, entities. I took the common attributes and stuck them in an abstract entity. I marked the abstract entity as a parent entity of the two original entities in my data model.

I can generate NSManagedObject subclasses without issue, and in code, I can manipulate attributes of instances of either child entity and have the app compile fine.

One of the child entities works just fine in runtime. However, when I attempt to mess with entity-only attributes on the other child entity, I get a crash with an *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[KUNLearnedItem setWord:]: unrecognized selector sent to instance 0x7ffec0d08ee0'.

If I turn off the parent/child relationship for the one entity and regenerate NSManagedObject subclasses, I can manipulate the attributes just fine.

Any thoughts? I've been pulling my hair out for days over this.

1

1 Answers

0
votes

It was a bug related to finding the entity name in the core data library I was using. I installed and used Mogenerator to generate NSManagedObject subclass files and all is well.