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

  • SEARCH
  • Home
  • 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 6033871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:32:48+00:00 2026-05-23T05:32:48+00:00

I am working on an iPhone/iPad app that needs to display a running timecode

  • 0

I am working on an iPhone/iPad app that needs to display a running timecode clock. I have gotten it to display the correct hours, minutes, and seconds with no problem using this code:

    - (void) viewDidLoad {
        // Start the Timer method for here to start it when the view loads.
            runTimer = [NSTimer scheduledTimerWithTimeInterval: .01 target: self selector: @selector(updateDisplay) userInfo: nil repeats: YES];
    }

- (void)updateDisplay {
        NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
        NSDate *date = [NSDate date];

        // Display each hour, minute, second and frame.
        [formatter setDateFormat:@"hh"];
        [timecodeHourLabel setText:[formatter stringFromDate:date]];

        [formatter setDateFormat:@"mm"];
        [timecodeMinuteLabel setText:[formatter stringFromDate:date]];

        [formatter setDateFormat:@"ss"];
        [timecodeSecondLabel setText:[formatter stringFromDate:date]];
}

The issue is when I need to display frames per second. I know that calculating 1/24 * 1000 gives me how many milliseconds are in one frame. I just don’t know how to make the NSDate and NSTimer functions work with this code and allow it to update a UILabel as quickly as needed for running timecode.

Any suggestions?

  • 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-23T05:32:48+00:00Added an answer on May 23, 2026 at 5:32 am

    If your timer is running with the period of 0.01 sec, then it’s frequency is 100 frames/sec (well, it’s better to say it has 100 function calls per second). But if you need to display the precise time period (cause sometimes the timer may be delayed), then you need to store the previous call date and then use

    NSDate* new_date = [NSDate date];
    double freq = 1.0 / [new_date timeIntervalSinceDate: old_date];
    [old_date release];
    old_date = [new_date retain];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're working on a web app that will deployed to mobile devices, iPad, iPhone,
I have a very strange bug in a shipping iPad/iPhone app that I can't
I am working on an MKMapView based iPhone / iPad mapping app that overlays
I have written a universal app that's working fine on both iPhone (iPod Touch)
I'm working on an iPhone application. I have an object of class Row that
I've tested my app thoroughly on the simulator, but I don't have an iphone/ipad/ipod
I'm working on a bitmap editor app for the iPad/iPhone and I'd like to
I am developing a iphone/ipad app. Problem is that when i change the orientation
For the past few weeks I have been working on an app that uses
I am trying to display my iphone/Ipad app on my iPad but getting this

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.