usually you do something like this in the application delegate in the method didFinishLaunchingWithOptions. When you use an ivar to save the current instance of NSTimer, you can stop it anytime.
@implementation AppDelegate {
NSTimer *_timer;
}
- (void) start {
_timer = [NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(execute) userInfo:nil repeats:YES];
}
- (void) stop {
//reset timer
if (_timer != nil) {
[_timer invalidate];
_timer = nil;
}
}
- (void) execute {
//do something
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[self start];
}
but you should use a callback via block if you only want to check another threads status.
if you want to execute something on the main thread from another thread you can use dispatch_get_main_queue:
dispatch_async(dispatch_get_main_queue(), ^{
//do something
});