I searched around the internet for an answer but with no luck. I tried
- (void)viewDidLoad {
[super viewDidLoad];
twoMinTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timer) userInfo:nil repeats:YES]; }
- (void)timer {
for (int totalSeconds = 120; totalSeconds > 0; totalSeconds--){
timerLabel.text = [self timeFormatted:totalSeconds];
if ( totalSeconds == 0 ) {
[twoMinTimer invalidate];
} } }
but it didn't work, the label went from 2.00 to 0.01 when I went to that view and then it just stopped.
Any advice would be greatly appreciated - Philip