I have a managed core data object with a +initialize
method. (If it matters, I am looking to use that method to initialize a static variable that is expensive to to set up.) While testing that initialization code I was surprised to discover that the +initialize
method is getting called twice.
The first time initialize
is being called self
is defined as (Class) MyClass
, as I would expect.
The second time initialize
is being called self
is defined as (Class) MyClass_MyClass_
, which leads me to suspect some sort of unusual initialization for Core Data managed objects.
While this doesn't pose a problem for me (I can just test to see if the static variable has already been initialized, which I would do anyway, to handle ubclassing), it makes me suspect that Core Data is doing something in the object or class lifecycle that I don't understand. Can someone explain to me what is going on in this MyClass_MyClass_
+initialize
method invocation?