Re: Bindings do not work in threads?
Re: Bindings do not work in threads?
- Subject: Re: Bindings do not work in threads?
- From: Chris Hanson <email@hidden>
- Date: Fri, 14 Oct 2005 18:33:04 -0700
On Oct 12, 2005, at 2:25 AM, Theo Vosse wrote:
It seems that both threads are trying to update the bindings
themselves, instead of just letting the main thread do that. Is
that correct? If so, is there another solution than having some
kind of poll/wait loop in the main thread?
Bindings are not thread-safe; Key-Value Observing notifications are
posted in the thread in which they originate.
You should have your threads communicate with the main thread, so
that the main thread updates the object whose attributes your
controls are bound to.
One way to do this would be to use -[NSObject
performSelectorOnMainThread:withObject:waitUntilDone:].
-- 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