I have a popup in a custom view controller that is presented after 1 minute thanks to my NSTimer
.
My NSTimer
code:
[NSTimer scheduledTimerWithTimeInterval:60.0f
target:self selector:@selector(methodB:) userInfo:nil repeats:YES];`
The method that reveals the popup
- (void) methodB:(NSTimer *)timer
{
//Do calculations.
[self showPopupWithStyle:CNPPopupStyleFullscreen];
}
I'm trying to set the NSTimer
to stop running if the [self showPopupWithStyle:CNPPopupStyleFullscreen];
is currently open, running or active.
Then I would like to start the NSTimer
back up again if the popup view controller is NOT open, running or active.
Any help, samples or examples would be greatly appreciated!
My project is written in Objective-C.
EDIT:
I tried the answers in the suggested "possibly similar" answer and it doesn't seem to work for what I am doing. How do I stop NSTimer
?