Binding to NSArrayController selection

  • I've built a custom view that I'm trying to make a little more IB
    friendly.  I've built it into an IBPalette, and now I'm trying to
    make it a little more friendly to bindings.

    The view generates data plots.  It can display multiple data sets
    simultaneously, and maintains an NSMutableArray of data set objects.
    Each data set maintains an NSMutableArray of data points.  I've
    successfully bound an NSArrayController to the array of data sets,
    and I'll deal with the data points later.

    When I click on a data set, the view recognizes the data set being
    selected and highlights it.  Multiple data sets can be selected
    simultaneously.  The selection is maintained by the view and an
    NSMutableArray containing the selected sets (in no particular order).

    How do I get the controller to recognize my selection so I could,
    say, list the data sets in a table and highlight those selected, or
    modify properties of the selected sets?  I'm trying to avoid making
    the view aware of the controller because I don't want to force an
    application to use one, which is why I'd like to do this through
    bindings rather than calling the methods on the controller directly.

    Thanks for any help.  If I need to make the structure more clear,
    please ask.
  • Sorry, just realized there's a very similar thread just a couple
    posts ago.  I'll read that and then repost if I'm still having issues.

    On Oct 24, 2007, at 12:00 AM, Greg Best wrote:

    > I've built a custom view that I'm trying to make a little more IB
    > friendly.  I've built it into an IBPalette, and now I'm trying to
    > make it a little more friendly to bindings.
    >
    > The view generates data plots.  It can display multiple data sets
    > simultaneously, and maintains an NSMutableArray of data set
    > objects.  Each data set maintains an NSMutableArray of data
    > points.  I've successfully bound an NSArrayController to the array
    > of data sets, and I'll deal with the data points later.
    >
    > When I click on a data set, the view recognizes the data set being
    > selected and highlights it.  Multiple data sets can be selected
    > simultaneously.  The selection is maintained by the view and an
    > NSMutableArray containing the selected sets (in no particular order).
    >
    > How do I get the controller to recognize my selection so I could,
    > say, list the data sets in a table and highlight those selected, or
    > modify properties of the selected sets?  I'm trying to avoid making
    > the view aware of the controller because I don't want to force an
    > application to use one, which is why I'd like to do this through
    > bindings rather than calling the methods on the controller directly.
    >
    > Thanks for any help.  If I need to make the structure more clear,
    > please ask.
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today