I have two entities – A and B. A includes a set of Bs. Every time I create a B, I want to make sure I add it to a special instance of A.
Looking at the NSManagedObjectClass reference, it is very clear that I should NOT be overriding the init method. So where is the best place to “catch” the creation of B? The only way I can see is to use validateForInsert, but I’m concerned that that’s not really what it’s meant for, and thus may cause headaches down the road. Is there a better option?
From the NSManagedObject documentation:
Subclass this method on your entity’s class.