I have a managed main data object using a method +initialize. (If that matters, I want to use this method to initialize a static variable, which is expensive to set up.) When testing this initialization code, I was surprised to find that the method +initializegets called twice.
The first call initialize selfdefines how (Class) MyClass, as one would expect.
The second time initializeit selfis called is defined as (Class) MyClass_MyClass_, which makes me suspect some kind of unusual initialization for objects managed by Core Data.
Although this does not pose a problem for me (I can just check if the static variable was initialized, which I would do to handle ubclassing), it makes me suspect that Core Data is doing something in the life cycle of an object or class that I do not understand. Can someone explain to me what happens in this method call MyClass_MyClass_ +initialize?
source
share