まず、あなたのコードについてお聞きしたいと思います。
また、今回はこのパターンでやります。
@property (nonatomic) NSInteger remainingTime;
@property (nonatomic) NSTimer *timer;
timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(timerAction) userInfo:nil repeats:YES];
- (void)timerAction {
if (!countingFinish) {
remainingTime --;
//backend regular action
[self frontEndUpdate];
}else {
[timer invalidate];
}
}
- (bool)countingFinish {
return (reamainingTime <= 0);
}
- (void)frontEndUpdate {
//update time label, or other front end update action
}
- (void)addCountingRemaining:(NSInteger) _sec {
remainingTime += _sec;
[self frontEndUpdate];
}
ところで、これは juz ドラフト コードです。それが役に立てば幸い