I have a CoreData application which is using SyncServices (via 
NSPersistentStoreCoordinatorSyncing). A couple of entities contain transient 
attributes (transient values are not synced). The sync works fine & as expected.
However, when the managed object context is reloaded after the sync is 
complete, the managed objects which contain transient values fault 
(didTurnIntoFault: is called) and are recreated (awakeFromFetch is called), 
even though nothing has changed, except for the contents of the transient 
attributes. This only seems to happen on the first sync after the application 
is launched, subsequent syncs doesn't fault the managed objects. 

I have also noticed that the NSManagedObjectContextObjectsDidChangeNotification 
notification is never broadcast in this situation. Therefore, anything that 
contains a reference to a managed object contains an invalid reference, and I 
have no way of knowing when I need to update the reference (I guess I could 
retain the MO and call isFault before each use, but that doesn't seen nice)

- Is it expected behaviour to fault and awakeFromFetch a managed object with 
transient attributes after a sync?
- Why does this only happen to MO's with transient attributes (it may happen 
with others, I just haven't experienced it)?
- Is there anyway to prevent this from happening e.g. change the merge policies 
on the NSManagedObjectContext?

Hope I have made my problem clear.

Thanks,
Tom

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to