Re: efficient iTune-style filter
Re: efficient iTune-style filter
- Subject: Re: efficient iTune-style filter
- From: Ondra Cada <email@hidden>
- Date: Sun, 28 Oct 2001 10:37:56 +0100
Jake,
>
>>>>> Jake (J) wrote at Sun, 28 Oct 2001 02:04:31 -0500 (EST):
J> I can try to use a data variable to track
J> the time elapsed, and compare with the last key to see if sufficient time
J> has expired. However, I was wondering if there is a more elegant
J> solution to this
Might be questionable what's clean and what's cleaner ;)
I'm used to use for such situations the following pattern:
-(void)toBePerformedOnlyIfXxxDidNotHappenForAwhile:data {
...
}
-...theActionXxx... {
[NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(toBePerformedOnlyIfXxxDidNotHappenForAwhile)
object:something];
...
[self
performSelector:@selector(toBePerformedOnlyIfXxxDidNotHappenForAwhile)
withObject:something afterDelay:theDesiredDelay];
}
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc