Document.xib包含两个窗口,一个窗口需要是首选项面板 [英] Document.xib contains two windows, one window needs to be a preference panel

查看:135
本文介绍了Document.xib包含两个窗口,一个窗口需要是首选项面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Core Data创建了一个基于文档的应用程序。我用两个窗口替换了Document.xib中自动创建的窗口:面板窗口和窗口窗口。

I have created a Document-Based Application using Core Data. I replaced the automatically created window in Document.xib with two windows: a "Panel" window and a "Window" window.

面板窗口包含一个表视图与绑定到NSArrayController。表视图用于使用文档类的实体和属性将数据添加到数组。我想让这个窗口充当首选项窗口。

The "Panel" window contains a table view with bindings to an NSArrayController. The table view is used to add data to the array using the document class's entities and attributes. I would like to make this window act as a Preferences window. This window should appear when a button in the main "Window" is clicked.

窗口是我的主窗口,我使用绑定显示来自同一个NSArrayController的数据。

The "Window" is my main window where I display data from the same NSArrayController using bindings. This window contains a button that I would like to use to make the "Panel" window appear.

我可以在启动时隐藏面板窗口,只显示主窗口窗口,但我不知道如何设置按钮的操作来显示面板窗口。

I can hide the "Panel" window upon launch and only show the main "Window", but I can't figure out how to set the action of the button to show the "Panel" window.

有关如何完成这个任务的任何想法? ?

Any thoughts on how to accomplish this??

我尝试使用两个单独的XIB文件,但是我有一个问题,我不能得到NSArrayController数据到另一个窗口。

I tried using two separate XIB files, but then I have a problem where I can't get the NSArrayController data into the other window.

推荐答案

尝试将按钮的操作选择器连接到面板的 makeKeyAndOrderFront:操作。

Try connecting your button's action selector to your panel's makeKeyAndOrderFront: action.

这篇关于Document.xib包含两个窗口,一个窗口需要是首选项面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆