Re: NSThread call back...
Re: NSThread call back...
- Subject: Re: NSThread call back...
- From: Chris Hanson <email@hidden>
- Date: Wed, 9 Nov 2005 22:25:29 -0800
On Nov 9, 2005, at 10:02 PM, Dustin Voss wrote:
If it does UI, directly or indirectly, it should be executed in the
main thread's context. If it just adjusts data values, it can be
executed in any thread context, but you'll have to provide some
sort of locking mechanism if you don't use the main thread context.
It's a little more complicated than that. If what you want to do
involves changing properties that are used in bindings or are
otherwise being observed via Key-Value Observing, that must be done
on the main thread because KVO is not thread-safe.
This is part of why there is a strong suggestion to Core Data users
to use a separate NSManagedObjectContext and set of objects per
thread. If you do that, then you're minimizing the risk that you'll
have managed objects that are bound to but also being manipulated in
some other thread.
-- 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