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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:39:05+00:00 2026-06-18T05:39:05+00:00

I have a strange issue with my countDown timer. This timer is counts down

  • 0

I have a strange issue with my countDown timer. This timer is counts down from a set time (i.e. 60 seconds). This bit of code is placed in myViewDidLoad method. Everything works unless I go back and load the view again. Every time the view loads, there is an increment of 1 second in the countdown.

For example:

  1. First Load: 60, 59, 58…
  2. Second Load: 60, 58, 56…
  3. Third Load: 60, 57, 54…

My code is below. Does anyone know why this is happening? Do I need to release something somewhere? Thank you!

countDown=[NSTimer scheduledTimerWithTimeInterval:1.0 target:self 
selector:@selector(TimeOver) userInfo:nil repeats:YES];
  • 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-18T05:39:07+00:00Added an answer on June 18, 2026 at 5:39 am

    Each time your view loads, you create a new timer, but the old ones still exist. In your timer’s action method, TimeOver, you are decrementing an index variable that keeps track of the seconds, and each timer runs that method every time it fires. So, if you have three timers, the index will decrease by three each time.

    You need to either not create new a new timer whenever your view loads or, better, destroy the timer when your view disappears:

    [countDown invalidate];
    countdown = nil;
    

    and recreate it when it reappears.

    Also, be aware that your timer’s action method has an incorrect signature. It should be a method which returns nothing and takes one argument, which is the timer itself, like so:

    - (void)timeOver: (NSTimer *)tim;
    

    Also, Cocoa methods should not start with capital letters.

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

Sidebar

Related Questions

I have this strange issue. When I run application from Xcode (even on device),
I have a strange issue with jQuery's hover, addClass $(document).ready(function(){ $('#selectable li').hover( function(){ $(this).addClass('selecting',
I have a somewhat strange issue with visual studio. Almost every time I create
I have a strange issue. I am using google authentication and this works on
I have this strange issue that my git push origin master and cap deploy
I have this strange issue. Xcode target does not find my 3rd party mac
I have this strange issue, and im dealing with it for more than 8
I have a strange issue with my css navigation menu. The code is here:
I have a strange issue trying to run the Facebook iOS SDK DemoApp (from
I have this strange issue going on with my CSS on my site, and

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.