In the methods insertInManagedObjectContext:
provided by mogenerator
, there is no call to any super methods.
I wonder why.
Indeed,
ParentEntity
and ChildEntity
; of course, ParentEntity
is the parent entity of ChildEntity
.insertInManagedObjectContext:
of the ParentEntity
. ChildEntity
, none of my changes will be taken in account !!I was wondering why such a choice and maybe a solution.
My need is to create a super entity with children and that this super entity have two insert methods. I want these two insert methods to be usable by the children.
Probably they just didn't think of it the same way you do.
As for what you can do, why not implement your own method to take the place of insertInManagedObjectContext:
and have it call super's implementation? Generate the files, then put your new method in ChildEntity.m
, and have that version call super's version. You can't use the same method name since _ChildEntity.m
will have one that doesn't call super's version. So, use some other method name.