Hi i want to start a timer with another thread and want to repeat process in that thread. i had tried but it doesn't work.
my code snippet is given below
[NSThread detachNewThreadSelector:@selector(setupTimerThread) toTarget:self withObject:nil];
-(void)setupTimerThread
{
NSLog(@"inside setup timer thread");
// self.startTiemr = [[NSTimer alloc]init];
startTiemr = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(triggerTimer) userInfo:nil repeats:YES];
runLoop = [NSRunLoop currentRunLoop];
[runLoop addTimer:startTiemr forMode:NSRunLoopCommonModes];
[runLoop run];
}
can anyone suggest me a proper way to do that?
Thanks in advance.