how to show countdown on uilabel in iphone?

前端 未结 3 1608
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 01:44

i have a uilabel and a uislider on a view. i want to set label\'s time using slider.range of slider is 00:00:00 to 03:00:00. means 3 hours.and intervel on slider is 0.5 minutes.

3条回答
  •  礼貌的吻别
    2021-02-02 02:30

    This code is wrong.

    timer = [NSTimer scheduledTimerWithInterval: 1.0 target:self selector:@selector(updateCountdown) userInfo:nil repeats: YES];
    

    It should be.

    timer = [NSTimer scheduledTimerWithTimeInterval: 1.0 target:self selector:@selector(updateCountdown) userInfo:nil repeats: YES];
    

提交回复
热议问题