I'm wanting to make one of my methods to run every 60 seconds when my App is running, how would I do that?
NSTimer
- (void) startTimer
{
self.myTimer = [NSTimer scheduledTimerWithTimeInterval:60
target:self
selector:@selector(timerFired:)
userInfo:nil
repeats:YES];
}
- (void) stopTimer
{
[self.myTimer invalidate];
}
- (void) timerFired:(NSTimer*)theTimer
{
NSLog(@"yay");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With