我有NSTimer和动作它。但是我想在第一次5秒之后,第二次4秒之后打电话行动 ...。非相等scheduledTimerWithTimeInterval NSTimer 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];
});
}
因此,这意味着你要反转定时器,对不对? –
@HardikShah是的,没错。 –