Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I share an NSArrayController between two nib files?

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?

like image 738
Tom Dalling Avatar asked May 18 '10 00:05

Tom Dalling


1 Answers

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?

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

like image 123
Peter Hosey Avatar answered Sep 25 '22 17:09

Peter Hosey