Return to Snippet

Revision: 21042
at December 2, 2009 05:17 by funkypanda


Initial Code
// Create a timer that call taskToUpdate every 1.0 sec
NSTimer timer = [NSTimer scheduledTimerWithTimeInterval:(1.0) target:self selector:@selector(taskToUpdate) userInfo:nil repeats:YES];


// Stop the timer if it's running 
// (no way to "stop it" and "run it back", you must "kill it" and "recreate it")
if([timer isValid]){
    [timer invalidate];
    timerAffcheur = nil;
}

Initial URL


Initial Description


Initial Title
Start and Stop NSTimer to perform a task

Initial Tags


Initial Language
Objective C