Bindings with an NSMatrix of NSButtons

  • I feel so stupid and frustrated because it seems like it takes me 2
    days of headbanging and endless google searches, followed by a
    message to this list every time I try a new type of Binding. It's
    especially these ones with the "content" "contentObjects" and
    "contentValues" that drive me crazy. The documentation just makes my
    head spin.

    I want to bind an array to an NSMatrix of checkboxes. When I click
    one of the checkboxes, I want the corresponding object in the array
    to get updated. I can bind a single int to a single checkbox no
    problem, but I am totally stumped by NSMatrix Bindings. Am I supposed
    to make an array of NSNumber objects?

    The NSMatrix Bindings docs say:

    > content
    > An NSArrayController instance that provides the content of the
    > NSMatrix.
    So that is what I'm using. I have "arrangedObjects [testController
    (NSArrayController)]" bound.  But then it says that binding is read
    only, so I go ahead and set up a binding for:

    > contentObjects
    > An array of objects that are (sic) returned by selectedObject or
    > selectedObjects in place of the corresponding content object.
    > If content is not bound, the contentObjects binding is not available.

    Here I start to go nuts. What does selectedObject have to do with it?

    Does anyone have a sample or can describe how to do this binding? Or
    am I totally missing the fact that this binding is not possible?

    Thank you
  • I know it's very lame to reply to my own post asking again for help
    because there must have been something in my original post that made
    it unworthy of getting help the first time, but it's been two more
    days of me trying every possible conceivable combination to be able
    to bind an NSMatrix of checkboxes to an instance variable of objects
    in an array without success.

    All dignity is gone, I'm a total loser and I'm now officially begging.

    On Oct 24, 2007, at 11:40 AM, Paul Bruneau wrote:

    > I feel so stupid and frustrated because it seems like it takes me 2
    > days of headbanging and endless google searches, followed by a
    > message to this list every time I try a new type of Binding. It's
    > especially these ones with the "content" "contentObjects" and
    > "contentValues" that drive me crazy. The documentation just makes
    > my head spin.
    >
    > I want to bind an array to an NSMatrix of checkboxes. When I click
    > one of the checkboxes, I want the corresponding object in the array
    > to get updated. I can bind a single int to a single checkbox no
    > problem, but I am totally stumped by NSMatrix Bindings. Am I
    > supposed to make an array of NSNumber objects?
    >
    > The NSMatrix Bindings docs say:
    >
    >> content
    >> An NSArrayController instance that provides the content of the
    >> NSMatrix.
    > So that is what I'm using. I have "arrangedObjects [testController
    > (NSArrayController)]" bound.  But then it says that binding is read
    > only, so I go ahead and set up a binding for:
    >
    >> contentObjects
    >> An array of objects that are (sic) returned by selectedObject or
    >> selectedObjects in place of the corresponding content object.
    >> If content is not bound, the contentObjects binding is not available.
    >
    > Here I start to go nuts. What does selectedObject have to do with it?
    >
    > Does anyone have a sample or can describe how to do this binding?
    > Or am I totally missing the fact that this binding is not possible?
    >
    > Thank you
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