• 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
Re: Sliders and Timers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sliders and Timers


  • Subject: Re: Sliders and Timers
  • From: Jerry Krinock <email@hidden>
  • Date: Sun, 23 Sep 2007 18:08:02 -0700


On 2007 Sep, 23, at 17:22, Frank D. Engel, Jr. wrote:

If I start moving a slider, the timer is frozen until I release the mouse button.

More precisely, I'd say not that the timer is frozen, but the method which receives the timer's firing and sends your "periodic message" is delayed from running until after your main thread becomes unblocked by your moving the slider.


Any way to get the timer pulse delivered while I move the slider? I considered moving the timer into another thread (NSThread), but I'm not sure if that is the ideal solution or not?

Yes, I believe that's what you should do. Schedule the timer in another thread, in which your message will be sent.


The other thread should ideally be able to update other controls (not the sliders) while I am moving the slider. Any "easy" way to do this in Cocoa?

Look at -[NSObject performSelectorOnMainThread:withObject:waitUntilDone:modes:].


(I'm fairly new to Cocoa, have been playing with it on and off for a time, but have been looking at it somewhat more seriously over the past few days and am quite pleased so far, but this one is a blocker for what I am trying to do...)

Well, multithreading is never a good place to start, but you've got to do what you've got to do!
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Sliders and Timers (From: "Frank D. Engel, Jr." <email@hidden>)

  • Prev by Date: Re: Programmatic firewall configuration
  • Next by Date: Re: Sliders and Timers
  • Previous by thread: Sliders and Timers
  • Next by thread: Re: Sliders and Timers
  • Index(es):
    • Date
    • Thread