• 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: Re: Re: NSSlider did finish sliding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: Re: NSSlider did finish sliding


  • Subject: Re: Re: Re: NSSlider did finish sliding
  • From: "Michael Ash" <email@hidden>
  • Date: Sat, 2 Sep 2006 14:41:07 -0400

On 9/2/06, Bruce Johnson <email@hidden> wrote:
Thanks, it was just what I needed.

Maybe you could give a small explanation as to the underlying machinery of:

[NSObject cancelPreviousPerformRequestsWithTarget: self selector: sel
object: sender];

I'm happy that it works, but what is it doing.

Remove the line and see what breaks!

With a continuous slider, the action method is sent every time the
slider's value changes. This means that the delayed perform is
potentially called many times. If you just had the delayed perform,
they would all pile up and you'd get dozens or hundreds of sliderDone:
messages once the mouse was released. By cancelling any pending
messages before adding a new one, you ensure that only a single
sliderDone: message is actually sent.

Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSSlider did finish sliding (From: "Bruce Johnson" <email@hidden>)
 >Re: NSSlider did finish sliding (From: "Michael Ash" <email@hidden>)
 >Re: Re: NSSlider did finish sliding (From: "Bruce Johnson" <email@hidden>)

  • Prev by Date: Re: Object Layering is Changing When Calling -addSubview:
  • Next by Date: Re: Object Layering is Changing When Calling -addSubview:
  • Previous by thread: Re: Re: NSSlider did finish sliding
  • Next by thread: Re: NSSlider did finish sliding
  • Index(es):
    • Date
    • Thread