我有一组图像和两个 nib 文件。一个 nib 文件有一个在 NSTableView 中显示图像的窗口。另一个 nib 有一个窗口,可以将图像数组绘制到 NSView 中,并在所选图像上绘制高亮显示。
图像数组由 NSArrayController 控制。我无法让两个 Nib 共享 NSArrayController。我会有两个单独的 NSArrayControllers 绑定(bind)到相同的内容,但我也希望两个 nib 共享 Controller 的选择;也就是说,如果您在表格窗口中选择了一个图像,它也会在另一个窗口中被选中。
有没有标准的方法来做到这一点?
最佳答案
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.
Is there a standard way to do this?
将两个单独的 NSArrayController 绑定(bind)到相同的内容和 selection indexes .
关于objective-c - 如何在两个 nib 文件之间共享 NSArrayController?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2853931/