There is no way to "fix" it because it is not broken. Each context (and thus each thread) will have a separate instance of the NSManagedObject
. They are completely different objects in memory and will not share instance variables. You will need to initialize that instance variable in each instance.
That is why awakeFromInsert
and awakeFromFetch
fire on each context. It gives you an opportunity to initialize those instance variables.