我不明白为什么线程创建的窗口在线程结束后(ARC下)仍然存在?ARC和线程窗口
这就是所谓的:
-(void)prefsWindow:(id)sender {
NSRect frame = NSMakeRect(200, 200, 640, 480);
NSWindow *window = [[NSWindow alloc] initWithContentRect:frame
styleMask:NSTitledWindowMask | NSClosableWindowMask
backing:NSBackingStoreBuffered
defer:NO];
[window center];
[window makeKeyAndOrderFront:NSApp];
[NSThread exit];
}
通过
[NSThread detachNewThreadSelector:@selector(prefsWindow:) toTarget:self withObject:nil];
我希望它死导致其超出范围。谢谢!
无关的Xcode中,我编辑的问题。 – 2013-03-20 13:20:41