Re: CoreData - NSManagedObjectContext notifications - Save vs DidChange ?
Re: CoreData - NSManagedObjectContext notifications - Save vs DidChange ?
- Subject: Re: CoreData - NSManagedObjectContext notifications - Save vs DidChange ?
- From: Chris Hanson <email@hidden>
- Date: Wed, 5 Oct 2005 18:02:28 -0700
On Oct 5, 2005, at 1:38 PM, Simon Liu wrote:
This works okay if during my background thread's computation, I invoke
-save: on the private context. I have a notification handler to handle
NSManagedObjectContextDidSaveNotification. The handler is
responsible for
taking the updated objects from the private context and refreshing
them in
the application's shared context. So all good...
Notifications are delivered in the same thread in which they are
posted. They are not enqueued across threads or anything of the
sort. So when handling a notification from the thread's context, you
need to use a cross-thread communication mechanism to update your
human interface.
One possibility is to use -
performSelectorOnMainThread:withObject:waitUntilDone: from within
your notification handler.
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden