I have a function:
-(void)doTask{
NSLog(@"do task start.");
...
}
I want to run this function on another thread, this is what I tried:
NSThread *workerThread = [[NSThread alloc] init];
[workerThread start];
[self performSelector:@selector(doTask)
onThread:workerThread
withObject:nil
waitUntilDone:NO];
when I run it, the doTask
function is not executed. WHY?