我试图打开我的应用程序委托使用NSWindowController的窗口。 我创建了一个基本NSWindowController具有相关的NIB,并尝试以显示窗口的方法:
@implementation MyAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Show the main window from a separate nib
MyWindowController * theWindowController = [[MyWindowController alloc] initWithWindowNibName:@"MyWindowController"];
[theWindowController showWindow:self];
}
@end
当我启动应用程序,MyWindowController的窗口只出现一秒的(似乎是只要它启动释放)。
使用ARC,我怎么能强迫窗口停留并不会立即刷新? 我不使用NSDocuments,我希望能够使用许多MyWindowController的同时。