re: Core Data, transient properties and saving
re: Core Data, transient properties and saving
- Subject: re: Core Data, transient properties and saving
- From: Ben Trumbull <email@hidden>
- Date: Fri, 23 May 2008 14:32:30 -0700
As a summary, you can't fetch or sort against transient properties
reliably. They don't exist in the persistent store (database).
The in memory filtering will apply your predicate to any dirty
objects to reconcile unsaved changes with the results from the
persistent store.
So saving the store has turned all my file objects into faults.
Not exactly, the managed objects are marked clean (not dirty) after
saving. Since the objects are no longer dirty, the MOC's filtering
will not post process them for unsaved changes.
How can I work around this? I could always walk the tree and ask each
file if they're edited, but a fetch seems cleaner.
You should probably keep an NSSet of "edited" objects.
Alternatively, you could make it a persistent property and manage the
consequences of that.
--
-Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden