Re: setNeedsDisplay: thread safe?
Re: setNeedsDisplay: thread safe?
- Subject: Re: setNeedsDisplay: thread safe?
- From: lbland <email@hidden>
- Date: Thu, 8 Apr 2004 18:48:47 -0400
On Apr 8, 2004, at 6:32 PM, Mike R. Manzano wrote:
So, from an auxiliary thread, something like
[ myView performSelectorOnMainThread:@selector( setNeedsDisplay: )
withObject:YES
waitUntilDone:NO ] ;
Is "YES" a valid object to be passing?
hi-
Nope.
Don't know exactly what you are doing, but this is what I might do:
put this in your controller class:
+ (void)setNeedsDisplayOnMainThread:(id)object
{
[object setNeedsDisplay:YES];
}
then call it like this:
[MyController performSelectorOnMainThread:@selector(
setNeedsDisplayOnMainThread: )
withObject:myView
waitUntilDone:NO ] ;
or if you want add setNeedsDisplayOnMainThread: in a category of NSView
as a instance method and call it like:
[myView performSelectorOnMainThread:@selector(
setNeedsDisplayOnMainThread: )
withObject:myView
waitUntilDone:NO ] ;
but assigning as a instance method isn't good because it is a stateless
method.
again, I don't know your system design, and run loops, threading, etc.
use need your system level design understanding, so I can't say for
sure. You might want a "display controller", and there are also other
ways that might be better depending on what you need.
good luck!
thanks!-
-lance
_______________________________________________
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.