如何在两个nib文件之间共享NSArrayController? [英] How do I share an NSArrayController between two nib files?

查看:125
本文介绍了如何在两个nib文件之间共享NSArrayController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个图像数组和两个nib文件。一个nib文件有一个窗口,显示在NSTableView中的图像。另一个nib有一个窗口,它将图像数组绘制到NSView中,并在所选图像上绘制一个突出显示。

I have an array of images, and two nib files. One nib file has a window that displays the images in an NSTableView. The other nib has a window that draws the array of images into an NSView, and also draws a highlight over the images that are selected.

图像数组由一个NSArrayController。我有麻烦获取两个nibs共享NSArrayController。我将有两个单独的NSArrayControllers绑定到相同的内容,但我也希望两个nibs共享控制器的选择;也就是说,如果您在表格窗口中选择一个图像,它也会在另一个窗口中选择。

The array of images is controlled by an NSArrayController. I'm having trouble getting the two nibs to share the NSArrayController. I would have two separate NSArrayControllers bound to the same content, but I also want both nibs to share the controller's selection; that is, if you select an image in the table window, it also becomes selected in the other window.

有标准的方法吗?

推荐答案


我会有两个单独的NSArrayControllers绑定到相同的内容,但我也希望两个nibs共享控制器选择;也就是说,如果您在表格窗口中选择一个图像,它也会在另一个窗口中选择。

I would have two separate NSArrayControllers bound to the same content, but I also want both nibs to share the controller's selection; that is, if you select an image in the table window, it also becomes selected in the other window.

有标准的方法吗?

有两个单独的NSArrayController绑定到相同的内容和选择索引

Have two separate NSArrayControllers bound to the same content and selection indexes.

这篇关于如何在两个nib文件之间共享NSArrayController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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