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 8257973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:22:55+00:00 2026-06-08T02:22:55+00:00

I have a countdown TextField which I like to update every minute automatically in

  • 0

I have a countdown TextField which I like to update every minute automatically in my iPhone app.

When the specific screen is visible it should count down – when switching to another screen the countdown obviously must not be updated.

When returning to the screen the countdown should continue again…

What would be the correct way of handling this?

Many thanks!

  • 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-06-08T02:22:57+00:00Added an answer on June 8, 2026 at 2:22 am

    I would use an NSTimer. Here is the documentation for NSTimer.

    Here is a snippet of code on how to set up a timer and get it to call a method:

    NSTimer *theTimer = [NSTimer timerWithTimeInterval:60 target:self selector:@selector(updateTime) userInfo:nil repeats:NO];
    

    This timer will call the updateTime method every time it fires. I have set it to NOT repeat, and instead, I would create a new timer each time I call the updateTime method. That way if you leave the UIViewController behind it will not keep firing the NSTimer.

    Here is a generic updateTime method:

    -(void) updateTime
    {
        //Update user interface
    
        NSTimer *theTimer = [NSTimer timerWithTimeInterval:60 target:self selector:@selector(updateTime) userInfo:nil repeats:NO];
    }
    

    The timeInterval is in seconds, so this timer will keep firing every 60 seconds. You may wish to cut it a little shorter, like 30 seconds, or even 1 second and check the system time to see when you need to update your countdown.

    I hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi i have a little Countdown Timer in my App which shows every second
I wrote simple iOS app which countdown the time til midnight. I have single
I have created an application.in the app i start a countdown timer and save
I have got a piece of code, that should countdown some number (in this
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I currently have the following code to show a countdown to a specific date:
I have an app that runs a countdown timer and brings up an alertbox
I have a program (specifically my entry for the SO DevDays Countdown app challenge
I'm building something which has a countdown to a certain date/time. I have it

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.