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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:04:36+00:00 2026-06-13T06:04:36+00:00

I am currently making a application using NSTimer as base for recording time. However,

  • 0

I am currently making a application using NSTimer as base for recording time. However, in the event that the player used a hint or forfeit on the current question, I would like to have a penalty of increasing time to the on-going NSTimer.

The question I have is, is it possible to add in more value to the on-going NSTimer?
e.g The timer is at 0:23:41.2, and the user press hint/forfeit. I want to have a function that add, lets say 10min. How do I make a function such that the timer will become 0:33:41.2 when the player press hint/forfeit?

I tried finding on google and SO on articles related to NSTimer and came across this SO thread which might be useful. How to value for NSTimer

Instead of elapse time as shown in the thread, I think I could swap it with a variable like below. (But if the example I shown below is not feasible, please enlighten me. I really want to make this game a successful one)

-(BOOL)hintButtonPressed

.

-(void) timerFireMethod:(NSTimer *) theTimer {

        if (hintButtonPressed == true) {
            // do something to increase value
            [theTimer invalidate];
        } 
}
  • 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-13T06:04:37+00:00Added an answer on June 13, 2026 at 6:04 am

    Even though I would not use a NSTimer for a countdown, there is an easy way to add time to its fireDate:

    [_timer setFireDate:[[_timer fireDate] dateByAddingTimeInterval:600]];
    

    This would add 10 minutes (600 seconds) to my _timer.

    And the best solution for your example would be to create an action-method for the button and check in that action-method whether the user already got a time bonus.

    Of course you can modify the fireDate in the fire method but it won’t fire again with my codeline.

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

Sidebar

Related Questions

I am currently making a time-clock system that is inside of a custom-built application
I am using SQLite in a project used by an android application. Currently I
I'm currently making an SMS viewing application and using the ContentResolver to obtain all
I'm currently making a jQuery Mobile application and using Phone Gap to deploy to
I'm currently making a simple inventory system application using Excel VBA. I have a
I'm currently making an application with Backbone.js and some JQuery libraries. Today I work
At school we are busy making a Spotify application. I am currently making an
Currently planning on making the installation process for a .NET application I'm selling smoother
Currently i am looking into making a bar chart in my WPF application. Although
I am making a logical gates application and I can currently drag out bitmaps

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.