如何在两个 nib 文件之间共享 NSArrayController?
我有一组图像和两个 nib 文件。一个 nib 文件有一个窗口,在 NSTableView 中显示图像。另一个笔尖有一个窗口,可将图像数组绘制到 NSView 中,并在选定的图像上绘制突出显示。
图像数组由 NSArrayController 控制。我无法让两个笔尖共享 NSArrayController。我将有两个单独的 NSArrayController 绑定到相同的内容,但我也希望两个笔尖共享控制器的选择;也就是说,如果您在表格窗口中选择图像,那么它也会在其他窗口中被选中。
有没有标准的方法来做到这一点?
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.
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.
Is there a standard way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两个单独的 NSArrayController 绑定到相同的内容,并且 选择索引。
Have two separate NSArrayControllers bound to the same content and selection indexes.