Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1087981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:00:42+00:00 2026-05-16T23:00:42+00:00

As in most games i hv seen the timer in a format 01:05 I

  • 0

As in most games i hv seen the timer in a format “01:05”

I m trying to implement a timer, and on reset i need to reset the timer to “00:00”.

This timer value should be in label.

How to create a timer which is incrementing? like 00:00—00:01—00:02……….somthing like dat.

suggestions

regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:00:43+00:00Added an answer on May 16, 2026 at 11:00 pm

    A Simple way I’ve used is this:

    //In Header
    int timeSec = 0;
    int timeMin = 0;
    NSTimer *timer;
    
    //Call This to Start timer, will tick every second
    -(void) StartTimer
    {
         timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerTick:) userInfo:nil repeats:YES];
         [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];
    }
    
    //Event called every time the NSTimer ticks.
    - (void)timerTick:(NSTimer *)timer
    {
         timeSec++;
         if (timeSec == 60)
         {
            timeSec = 0;
            timeMin++;
         }
         //Format the string 00:00
         NSString* timeNow = [NSString stringWithFormat:@"%02d:%02d", timeMin, timeSec];
         //Display on your label
         //[timeLabel setStringValue:timeNow];
             timeLabel.text= timeNow;
    }
    
    //Call this to stop the timer event(could use as a 'Pause' or 'Reset')
    - (void) StopTimer
    {
        [timer invalidate];
        timeSec = 0; 
        timeMin = 0;
         //Since we reset here, and timerTick won't update your label again, we need to refresh it again.
         //Format the string in 00:00
         NSString* timeNow = [NSString stringWithFormat:@"%02d:%02d", timeMin, timeSec];
         //Display on your label
    // [timeLabel setStringValue:timeNow];
           timeLabel.text= timeNow;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just wondering if most games on the iPhone are done in OpenGL
Most of my user stories end up with tasks for create code review, carry
Most things are dynamic in SSRS i.e you can create a custom expression for
Most of this info isn't needed to answer my question, I am including it,
I wonder what techniques xfire and/or Steam uses to overlay into games. I'm trying
I am programming a cocos2d game where, in most games, you must complete the
Most online games arbitrarily form teams. Often times its up to the user, and
Primarily this seems to be a technique used by games, where they have all
I am trying to implement a 'resume' feature for a game I'm developing. It
I'm dealing with a list of games and wanted to find out which player

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.