Accessing NSTextView from a thread (locking problem)
Accessing NSTextView from a thread (locking problem)
- Subject: Accessing NSTextView from a thread (locking problem)
- From: Allan Odgaard <email@hidden>
- Date: Sat, 6 Jul 2002 13:04:35 +0200
Hi there,
I have sub-threads which create output in their own NSTextViews -- this
gadget is handled entirely by the sub-thread, though when calling
setNeedsDisplay then the NSTextView will be redrawn by the main thread
(AFAIK).
For this reason I have added an NSLock to the NSTextView which I obtain
in the sub-thread (when adding text) and also in the drawRect selector
(which I've overloaded).
Unfortunately my program still has a tendency to freeze, and it seems to
always be while the sub-thread is adding to the NSTextView.
My next step will probably be to try and make the main thread handle all
the NSTextViews and then have the sub threads send data to the main
thread -- though I would like to know what could be the reason for my
problems?!?
_______________________________________________
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.