in my app there are two views. view1 has a function testing
-(void) testing
{
NSLog(@"Testing : %d", (++x));
}
and a timer
timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(testing) userInfo:nil repeats:YES];
what i want, is to stop and run this timer from view2. How to do that ?
Define Timer in AppDelegate,
And use timer in your both view by creating TimerDemoAppDelegate object
in your view .h file
in your view .m file
now use timer as appDelegate.timer.