Hi everybody,
So I'm coding an app where there is a timer that counts down from 15 seconds.. I want the app to invalidate the timer at 0 seconds and display an actionsheet telling the time. I have the code for the actionsheet and everything else, but I can't figure out the code for the timer to invalidate at 0 seconds.
Here is my code
-(void)randomMainVoid {
mainInt --;
time.text = [NSString stringWithFormat:@"Time: %d", mainInt];
}
-(void)viewDidLoad {
mainInt = 15;
randomMain = [NSTimer scheduledTimerWithTimeInterval

-1.0/-1.0) target:self selector:@selector(randomMainVoid) userInfo:nil repeats:YES];
}
the timer counts DOWN from 15 but then goes to the negatives I want it to stop at 0 how do I do that?
Thanks for anyhelp