用NSWindowController加载笔尖没有效果
问题描述:
在我的应用程序中,我有“首选项”窗口。要加载此窗口我使用此代码用NSWindowController加载笔尖没有效果
- (IBAction)showPrefWindow:(id)sender {
NSWindowController * windowController = [[NSWindowController alloc] initWithWindowNibName:@"PrefWindow"];
[windowController window];
}
但这是没有影响(偏好窗口不打开)。
当我使用Xcode 4.1 DP1这个代码工作。现在我将Xcode升级到4.2并且代码无法正常工作。
哪里有问题? Thaks!
答
你试过调用“[[windowController window] makeKeyAndOrderFront:windowController];”?
我改变代码,因为你说,但这没有帮助。 –
那么你的窗口不存在,你确定“PrefWindow.xib”存在于你的项目中? –
Antwan van Houdt谢谢!我不明白为什么,但今天这个代码工作! –