Quote:
Originally Posted by Applekuchen
Hey guys,
I've got an NSTimer that counts up in one view, when I go to another view I want that the Timer continues counting up?
How can I do this?
Should I create a new timer in the second view?
|
A timer sends a message (or messages, for a repeating timer) to a single target object.
It sounds like you're creating a repeating timer that sends a message to one of your view CONTROLLERS. (Not a view, a view controller.)
Further, I gather that you're using the timer to increment a counter.
You can't make a timer send a message to 2 targets, or change targets once you create it.
If you change view controllers, you should invalidate the timer in the first view controller's viewWillDisappear method, and create a new timer in the second view controller's viewWillAppear method.