• 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: rate limiting calls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rate limiting calls


  • Subject: Re: rate limiting calls
  • From: Steve Mills <email@hidden>
  • Date: Tue, 28 May 2013 10:21:45 -0500

On May 28, 2013, at 10:16:07, Scott Ribe <email@hidden> wrote:

> On May 28, 2013, at 8:41 AM, Torsten Curdt wrote:
>
>> Any easier or more elegant way you could think of?
>
> Well, if you don't want to deal with a queue and background thread, use NSTimer. In setValue, cancel the timer if it exists, then create a new one scheduled to run .someting seconds. If a timer ever fires, do your calculation.
>
> Now if you *want* an occasional intermediate update while the user is dragging, then compare values or current time in setValue...

If you do that last idea, you'll have to make sure you have the final value get set on mouseUp, otherwise you might be ignoring it because not enough time has passed. If the value this slider is setting takes too much time to process, consider letting the calculation process after mouseUp, and let the slider change its value naturally.

--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157




_______________________________________________

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: 
 >rate limiting calls (From: Torsten Curdt <email@hidden>)
 >Re: rate limiting calls (From: Igor Elland <email@hidden>)
 >Re: rate limiting calls (From: Torsten Curdt <email@hidden>)
 >Re: rate limiting calls (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: rate limiting calls
  • Next by Date: Re: rate limiting calls
  • Previous by thread: Re: rate limiting calls
  • Next by thread: NSSlider, NSStepper, and NSTextfield with Bindings: how to display initial value?
  • Index(es):
    • Date
    • Thread