• 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: Bindings do not work in threads?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Bindings do not work in threads? (From: Theo Vosse <email@hidden>)

  • Prev by Date: Re: Window Controllers Not Linking
  • Next by Date: UInt8 * to NSString
  • Previous by thread: Re: Bindings do not work in threads?
  • Next by thread: NSFormatter, bindings & control:didFailToFormatString:
  • Index(es):
    • Date
    • Thread