Knotted Threads
Knotted Threads
- Subject: Knotted Threads
- From: email@hidden
- Date: Mon, 9 Jun 2003 22:14:07 -0400
Earlier I posted a problem in which an NSView was not updating during a
continuous NSSlider drag. I then posted that I had fixed the problem by
placing updating code in a separate thread. Now, for some reason, the
user interface (the slider and other buttons --even those which have no
connections) stop the extra thread, which inhibits the updating again.
How can I fix this problem once and for all?
Note: The extra thread is based on a function in the NSView that needs
updating, and that same NSView happens to be the controller (I am going
to separate them soon):
...
[NSThread detachNewThreadSelector: @selector(timerDrawingThread:)
toTarget: self withObject: nil];
...
- (void)timerDrawingThread: (id) argument
{
NSAutoreleasePool* pool = [NSAutoreleasePool new];
[NSTimer scheduledTimerWithTimeInterval: 0.01 target: self
selector: @selector(drawFrame:) userInfo:
nil repeats: YES];
[[NSRunLoop currentRunLoop] run];
[pool release];
}
...
- (void)drawFrame: (NSTimer*)timer
{
...
[self setNeedsDisplay: YES];
}
_______________________________________________
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.