У меня есть подобный тестовый код < /p>
- (void)viewDidLoad
{
[super viewDidLoad];
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(test) object:nil];
[thread start];
}
-(void)test
{
MyClass *my = [[[MyClass alloc] init] autorelease];
NSLog(@"%@",[my description]);
}
< /code>
Я не создавал никакого авторелиазапула для моего собственного потока, но когда поток выходит, объект "my" Just dealloc.chy?- (void)viewDidLoad
{
[super viewDidLoad];
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(test) object:nil];
[thread start];
}
-(void)test
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
MyClass *my = [[[MyClass alloc] init] autorelease];
NSLog(@"%@",[my description]);
}
< /code>
Я создаю свой собственный AutoreLeasePool, но не истощаю его при выходе из потока. Объект "My" может все еще снять. Почему?>
Подробнее здесь: https://stackoverflow.com/questions/249 ... ically-now