Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
how to implement a Game Count Down timer
I have a simple App to score a Game, in this case Australian Rules Football, it has a main screen to keep score by pressing buttons. I wish to add a Count Down timer that you start and on the screen you see it count down.
At the same time i need the ability when a button is pressed to go to the code to increase the game score.
Q. option 1
do i need to implement a second run thread to keep the timer going?
if so is there a good tutorial on this?
Option 2.
do i have a main loop updating the timer and then monitor for button presses and exit do the score updated then go back to main timer loop.
seem complex any suggestions???
0 •
Replies
Many examples can be found how to setup a NSTimer.
If you're using a UIButton, then you need to add a UIControlEventTouchUpInside event to capture
touches, like:
[myButton addTarget:self action:@selector(myMethodForButton:) forControlEvents:UIControlEventTouchUpInside];
And you should always keep your timer code and scoring code separate. Do not try to update
your score from your clock timer. Update your score through events instead.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome