• 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: CoreData - trying to avoid separate thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData - trying to avoid separate thread


  • Subject: Re: CoreData - trying to avoid separate thread
  • From: mmalc crawford <email@hidden>
  • Date: Thu, 4 Jan 2007 14:07:50 -0800


On Jan 4, 2007, at 1:41 PM, Richard Salvatierra wrote:

The problem is I am creating new objects and inserting them into a managedObjectContext.
([NSEntityDescription insertNewObjectForEntityForName: @"Media" inManagedObjectContext: managedObjectContext])
My understanding, and findings, is that CoreData is not thread safe. I have a text field bound to an arrayController with a displayPattern that will show the count of items in that arrayController. This does not update properly if my import routine is in a separate thread. It leaves off the last item (for a few seconds anyway, then updates properly) Unless there is a way to force the controller to update properly. ArrangeObjects and RearrangeObjects does not do the job.


You should not bind the array controller's managedObjectContext to the MOC in the secondary thread.
See <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdMultiThreading.html > and the BackgroundFetching example in /Developer/Examples/CoreData/.


mmalc

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >CoreData - trying to avoid separate thread (From: Richard Salvatierra <email@hidden>)
 >Re: CoreData - trying to avoid separate thread (From: Chris Suter <email@hidden>)
 >Re: CoreData - trying to avoid separate thread (From: Richard Salvatierra <email@hidden>)

  • Prev by Date: Re: CoreData - trying to avoid separate thread
  • Next by Date: [Moderator] EOT (Re: Enabling a Menu item)
  • Previous by thread: Re: CoreData - trying to avoid separate thread
  • Next by thread: Re: CoreData - trying to avoid separate thread
  • Index(es):
    • Date
    • Thread