Pausing and Resuming a Countdown timer in a game
Hello Guys!
I have a question. How can I pause a countdown using a timer. I am developing a game. In the game, it has a pause button. When you tap it, it will go to a new view saying: "Paused". In there you have some options. The thing is that if I go to that pause view the countdown will still running. If I go back it will keep running What I want is that when I press the pause button, the timer will be paused and when I press the resume button, inside the pause view, the timer will resume.
I try this code in the view:
[timer pause];
// to resume
[timer resume];
I try that code, but I get a warning saying: "NSTimer may not respond to 'pause'"
I build with that waring and when I press the pause button, the app crash.
Can someone help me on this?
Thanks!
|