Working thread communicating with main thread (was: Threading Issues with Display)
Working thread communicating with main thread (was: Threading Issues with Display)
- Subject: Working thread communicating with main thread (was: Threading Issues with Display)
- From: email@hidden
- Date: Mon, 2 Jul 2001 00:23:22 +0200
I created a Thread that reads the received stream in OmniNetworking and
then updates an NSTextView with the additional String. Unfortunately the
TextView's display is not always updated when the string is added.
The point is that AppKit is not thread safe, so you have to use
connections to let the two threads communicate. Since it's a complicated
topic, and I had myself a large waste of time having it working, I have
written a web page on this subject:
http://lachand.free.fr/cocoa/Threads.html
Cocoa: How to have two threads communicating asynchroneously
The solution described here does work, but it is probably perfectible. So
don't hesitate to make suggestions, etc. (even for my english...).
Hope this help anyway.
Thomas Lachand-Robert
********************** email@hidden
The Commandant Project:
http://lachand.free.fr/
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.