• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Knotted Threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: <fixed> setting the bounds
  • Next by Date: Saving state of NSOutlineView
  • Previous by thread: Re: Good Habits (was: Re: C question for you old guys ;-))
  • Next by thread: Knotted Threads
  • Index(es):
    • Date
    • Thread