我在 Objective C 中创建新线程时遇到问题
- (void) create
{
NSLog( @"Hello World from create \n" );
NSThread* evtThread = [ [NSThread alloc] initWithTarget:self
selector:@selector( saySomething )
object:nil ];
[ evtThread start ];
}
- (void) saySomething
{
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
printf( "Hello world from new thread \n");
NSLog( @"Hello World from new thread \n" );
//[pool release];
}
但看起来方法 saySomething 没有被调用。控制台中没有打印任何内容。