0
타이머는 퀴즈를 시작할 때 "4 ... 3 ... 2 ... 1 ..."의 카운트 다운을 시작합니다. 퀴즈의 첫 번째 질문에서이 카운트 다운을 추가하고 싶습니다. 카운트 다운 후 첫 번째 질문이 표시됩니다. 카운트 다운 타이머는 4에서 1로 시작합니다.
어느 한 내가 이렇게 노력하고제발 도와 드릴까요하지만 난 카운트 다운 형식을 얻을 did'nt.
NSTimer *timer_total = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0 target:self selector:@selector(updateTimer) userInfo:nil repeats:YES];
- (void)updateTimer
{
NSDate *currentDate = [NSDate date];
NSTimeInterval timeInterval = [currentDate timeIntervalSinceDate:startDate_total];
NSDate *timerDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];
self.df_total = [[NSDateFormatter alloc] init];
[self.df_total setDateFormat:@"mm:ss"];
[self.df_total setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]];
NSString *timeString=[self.df_total stringFromDate:timerDate];
self.lbl_total_Timer.text = timeString;
}