Re: rate limiting calls
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