Knotted Threads
Knotted Threads
- Subject: Knotted Threads
- From: email@hidden
- Date: Tue, 10 Jun 2003 12:42:48 -0400
Earlier I posted a problem in which an NSView was not updating during a
continuous NSSlider drag (to be accurate, it was updating, but new
frames were not being updated by an NSTimer). I then posted that I had
fixed the problem by placing the NSTimer in a separate thread. Now, for
some reason, the user interface (the slider and other buttons --even
those which have no connections) temporarily stop the other thread when
they are pushed pressed on (not even clicked), 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 same NSView that
needs
updating, and that same NSView happens to be the controller:
...
[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
{
//doesn't actually draw.
[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.
_______________________________________________
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.