I have one-to-one relationship between entity A and entity B (one sided), for example named bRel. I have subclasses of NSAtomicStore
(MyStore) and NSAtomicStoreCacheNode
(MyCacheNode). In the load:
method of MyStore I create instances of MyCacheNode for entities A and B (aNode and bNode) and assign corresponding propertyCache dictionary for each one. The propertyCache for aNode contains bNode for key @"bRel"
.
The aManagedObject is created normally and has all the properties valid. But when aManagedObject accesses the bManagedObject through the aManagedObject.bRel.someAttribute
, the bManagedObject remains fault. bManagedObject doesn't receive awakeFromInsert
or awakeFromFetch
. The bNode and bManagedObject share the same instance of managedObjectID
. The bNode is alive when bManagedObject accesses someAttribute. When aManagedObject accesses its attributes, it goes through the valueForKey:
of MyCacheNode. When bManagedObject does, we don't get there.
bManagedObject just never fires at all.
Can anyone suppose what should I check in this situation?
yes. the problem may be that you have a Forward Declaration of aRel on your managed object. Try importing it on the aManagedObject.h file. that way, you should be able to access it's attributes.
Let me know how it goes :)
From current perspective I think I've just didn't call willAccessValueForKey:/didAccessValueForKey:
for synthesised properties, and that was irrelevant to customising store.
B was the synthesised property of A, AFAIR.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With