• 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: Torsten Curdt <email@hidden>
  • Date: Tue, 28 May 2013 17:19:34 +0200

Hey John,

thanks for the pointer. I used a similar pattern before but at that
time it was just a selector without parameter. AFAIU
cancelPreviousPerformRequestsWithTarget:selector:object will match the
object parameter to see what to cancel. (and nil is not a match-all).
Since here the parameter is changing it didn't feel like the right way
to go but...

On the other hand maybe I could just store away the value and the use
the same pattern for updates. Along the lines of

-(void)setValue:(NSObject*)value
	{
		self.value = value;

		[NSObject
			cancelPreviousPerformRequestsWithTarget:self
			selector:@selector(updateValue)
			object:nil];

		[self performSelector:@selector(updateValue)
			withObject:nil];
			afterDelay:kSliderDelay];
	}

	-(void)update
	{
		// slow update from self.value
	}

cheers,
Torsten
_______________________________________________

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

  • Follow-Ups:
    • Re: rate limiting calls
      • From: Torsten Curdt <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: John Pannell <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: Re: rate limiting calls
  • Index(es):
    • Date
    • Thread