Skip navigation.
 
mlre: Core Data, transient properties and saving
FROM : Ben Trumbull
DATE : Fri May 23 23:32:30 2008

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

Related mailsAuthorDate
mlCore Data, transient properties and saving Jonathan Dann May 23, 22:17
mlre: Core Data, transient properties and saving Ben Trumbull May 23, 23:32
mlRe: Core Data, transient properties and saving Jonathan Dann May 24, 00:36