从系统偏好设置窗格中的 NIB 打开窗口
我想在单击系统偏好设置窗格中的按钮时从 NIB 打开模式窗口。
我构建了一个 NIB 文件。文件所有者的类是NSWindowsController,其OUTLET'window'连接到目标窗口。然后当我加载窗口时:
NSWindowsController *ctl = [[NSWindowsController alloc] initWithWindowsNibName:@"XXX"];
[ctl loadWindow];
stderr 显示: -[NSWindowsController loadWindow] 无法加载窗口 nib 文件“XXX”
我尝试将 NIB 放入另一个简单的窗口应用程序中,它可以正常工作。
有人知道如何处理这个问题吗?
I want to open a modal window from NIB, when clicking a button in System Preference Pane.
I build an NIB file. The class of file's owner is NSWindowsController,and its OUTLET 'window' is connected to the target window. Then when I load the window:
NSWindowsController *ctl = [[NSWindowsController alloc] initWithWindowsNibName:@"XXX"];
[ctl loadWindow];
the stderr shows:
-[NSWindowsController loadWindow] failed to load window nib file 'XXX'
I try to put the NIB in another simple window app, and it can work well.
Anybody knows how to deal with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用“window”代替方法“loadWindow”
Instead of method "loadWindow" use "window"