J'ai NSTimer et Action pour cela. Mais je veux appeler Action après 5s pour la première fois, 4s pour la deuxième fois et ....non égal scheduledTimerWithTimeInterval pour NSTimer dans Objective-C
_timepast = 6;
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(handleDelay) userInfo:nil repeats:YES];
-(void)handleDelay
{
_timepast = _timepast - 1;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(_timepast * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self handleTimer];
});
}
Donc cela signifie que vous voulez inverser la minuterie, non? –
@HardikShah oui c'est vrai. –