Possibly Dumb Question

  • This should be an easy one, but I'm possibly just not thinking
    clearly right now.

    I have an NSTableView set up in Interface Builder.  The content is
    derived from an NSArrayController.

    Two of the three columns are read-only.  These are fine.

    The third is a bit tricky.  It has a "PopUp" cell type.  I have
    another NSArrayController representing a finite set of objects which
    are candidates to be assigned to a KVO-type "field" bound to the
    objects residing in the original NSArrayController; I want to display
    a value from the object, but select the object itself, not its name.

    In other words, if the rows of the table come from A, and I have a
    separate array controller B, I want the popup to list out the data
    from each B.name, and when I choose one, I want A.slot to be set to B
    (not the string B.name).

    Right now, I bound the "content" of the column to B.name, and
    "selectedObject" to A.slot, in both cases using "arrangedObjects"...

    Is there something simple that I did wrong here?

    Thank you!

    -----------------------------------------------------------
    Frank D. Engel, Jr.  <fde101...>

    $ ln -s /usr/share/kjvbible /usr/manual
    $ true | cat /usr/manual | grep "John 3:16"
    John 3:16 For God so loved the world, that he gave his only begotten
    Son, that whosoever believeth in him should not perish, but have
    everlasting life.
    $
  • Frank,

    It sounds like you want to bind the popup menu's content binding to
    the arrangedObjects of the "B" controller and the menu's contentValue
    binding to the arrangedObjects.name of the "B" controller.

    barry

    On 10/21/07, Frank D. Engel, Jr. <fde101...> wrote:
    > This should be an easy one, but I'm possibly just not thinking
    > clearly right now.
    >
    > I have an NSTableView set up in Interface Builder.  The content is
    > derived from an NSArrayController.
    >
    > Two of the three columns are read-only.  These are fine.
    >
    > The third is a bit tricky.  It has a "PopUp" cell type.  I have
    > another NSArrayController representing a finite set of objects which
    > are candidates to be assigned to a KVO-type "field" bound to the
    > objects residing in the original NSArrayController; I want to display
    > a value from the object, but select the object itself, not its name.
    >
    > In other words, if the rows of the table come from A, and I have a
    > separate array controller B, I want the popup to list out the data
    > from each B.name, and when I choose one, I want A.slot to be set to B
    > (not the string B.name).
    >
    > Right now, I bound the "content" of the column to B.name, and
    > "selectedObject" to A.slot, in both cases using "arrangedObjects"...
    >
    > Is there something simple that I did wrong here?
    >
    >
    > Thank you!
    >
    > -----------------------------------------------------------
    > Frank D. Engel, Jr.  <fde101...>
    >
    > $ ln -s /usr/share/kjvbible /usr/manual
    > $ true | cat /usr/manual | grep "John 3:16"
    > John 3:16 For God so loved the world, that he gave his only begotten
    > Son, that whosoever believeth in him should not perish, but have
    > everlasting life.
    > $
    >
  • Bingo!

    Thank you, that is what I was missing...

    On Oct 21, 2007, at 6:57 PM, Barry Wark wrote:

    > Frank,
    >
    > It sounds like you want to bind the popup menu's content binding to
    > the arrangedObjects of the "B" controller and the menu's contentValue
    > binding to the arrangedObjects.name of the "B" controller.
    >
    > barry
    >
    > On 10/21/07, Frank D. Engel, Jr. <fde101...> wrote:
    >> This should be an easy one, but I'm possibly just not thinking
    >> clearly right now.
    >>
    >> I have an NSTableView set up in Interface Builder.  The content is
    >> derived from an NSArrayController.
    >>
    >> Two of the three columns are read-only.  These are fine.
    >>
    >> The third is a bit tricky.  It has a "PopUp" cell type.  I have
    >> another NSArrayController representing a finite set of objects which
    >> are candidates to be assigned to a KVO-type "field" bound to the
    >> objects residing in the original NSArrayController; I want to display
    >> a value from the object, but select the object itself, not its name.
    >>
    >> In other words, if the rows of the table come from A, and I have a
    >> separate array controller B, I want the popup to list out the data
    >> from each B.name, and when I choose one, I want A.slot to be set to B
    >> (not the string B.name).
    >>
    >> Right now, I bound the "content" of the column to B.name, and
    >> "selectedObject" to A.slot, in both cases using "arrangedObjects"...
    >>
    >> Is there something simple that I did wrong here?
    >>
    >>
    >> Thank you!
    >>
    >> -----------------------------------------------------------
    >> Frank D. Engel, Jr.  <fde101...>
    >>
    >> $ ln -s /usr/share/kjvbible /usr/manual
    >> $ true | cat /usr/manual | grep "John 3:16"
    >> John 3:16 For God so loved the world, that he gave his only begotten
    >> Son, that whosoever believeth in him should not perish, but have
    >> everlasting life.
    >> $
    >>
    >

    -----------------------------------------------------------
    Frank D. Engel, Jr.  <fde101...>

    $ ln -s /usr/share/kjvbible /usr/manual
    $ true | cat /usr/manual | grep "John 3:16"
    John 3:16 For God so loved the world, that he gave his only begotten
    Son, that whosoever believeth in him should not perish, but have
    everlasting life.
    $
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