• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: Core Data, transient properties and saving
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core Data, transient properties and saving
      • From: Jonathan Dann <email@hidden>
  • Prev by Date: Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
  • Next by Date: Cover Flow in Cocoa?
  • Previous by thread: Core Data, transient properties and saving
  • Next by thread: Re: Core Data, transient properties and saving
  • Index(es):
    • Date
    • Thread