iPhone: NSTimer Countdown (Display Minutes:Seconds)

Posted by user298261 on Stack Overflow See other posts from Stack Overflow or by user298261
Published on 2010-04-13T02:21:36Z Indexed on 2010/04/13 3:23 UTC
Read the original article Hit count: 579

Filed under:
|
|

Hello!

I have my timer code set up, and it's all kosher, but I want my label to display "Minutes : seconds" instead of just seconds.

-(void)countDown{

    time -= 1;

    theTimer.text = [NSString stringWithFormat:@"%i", time];

    if(time == 0)
    {
    [countDownTimer invalidate];
    }
}

I've already set "time" to 600, or 10 minutes. However, I want the display to show 10:59, 10:58, etc. until it reaches zero.

How do I do this?

Thanks!

© Stack Overflow or respective owner

Related posts about nstimer

Related posts about countdown