我不明白爲什麼線程創建的窗口在線程結束後(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