我有问题
这是代码
- (void)start{
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantFuture]];
}
- (void)nlog{
NSLog(@"cool");
}
- (void)main{
thread = [[NSThread alloc] initWithTarget:self selector:@selector(start) object:nil];
[thread start];
[self performSelector:@selector(nlog) onThread:thread withObject:nil waitUntilDone:NO];
}
当我打电话时
[self performSelector:@selector(nlog) onThread:thread withObject:nil waitUntilDone:NO];
线程将继续运行,稍后我可以在线程中做一些事情;
但是如果我不调用它,线程将立即退出并且永远不能使用线程做任何事情,为什么?