• 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
Updating UI objects from another thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Updating UI objects from another thread


  • Subject: Updating UI objects from another thread
  • From: Luke Bellandi <email@hidden>
  • Date: Thu, 21 Feb 2002 11:40:06 -0800

What's the best way to update an AppKit object (specifically a text field)
from another thread? Say I have a clock I'm running in an NSThread, and all
the NSThread does is


int i = 0;
while (true) {
[timeField setIntValue: ++i];
usleep (50000);
}

So I would think this should update that field at 20Hz (which it does), but
the text rendering is sloppy: lots of overwrites and such. How can I update
a text field correctly outside the main application thread?

Thanks for the help!

Luke Bellandi
CoreAudio
Apple Computer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Updating UI objects from another thread
      • From: Finlay Dobbie <email@hidden>
  • Prev by Date: Re: Changing "MyDocument" to another class
  • Next by Date: Re: Tiff with mask
  • Previous by thread: Re: Changing "MyDocument" to another class
  • Next by thread: Re: Updating UI objects from another thread
  • Index(es):
    • Date
    • Thread