Olá pessoal,
Tenho uma thread secundaria que fica constantemente "medindo" algo. Ao iniciar esta thread faço duas coisas:
Inicio uma NSAutoReleasePool
Crio um timer para o meu NSRunLoop, que fica executando um selector especifico.
-(void) main{ NSLog(@"Thread wait time iniciada com sucesso!"); autoRelasePool = [[NSAutoreleasePool alloc] init]; [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(decreaseAndCount) userInfo:nil repeats:YES]; while (self.keepRunning) { @try { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; } @catch (NSException *exception) { [self.testStatus handleException:exception]; } } } [/CODE] Quando tento executar alguma coisa nesta Thread, eu não consigo. Estou, em outra thread, chamando o método performSelector: [CODE] [self performSelector:@selector(addWaitTimeData:) onThread:self.waitTimeThread withObject:waitTimeData waitUntilDone:TRUE]; [/CODE]