NSPopUpButton bindings bug

  • If a NSPopUpButton is directly bound to an immutable array (no indexed
    accessor methods), such as:

    content =  "model.anArray"
    contentValues = "model.anArray.string"

    It behaves as if the contentValues were bound like this:

    contentValues = "<model.anArray....>"

    ...because the button will not create items for duplicate strings in
    the array.  Should I file a bug?  Is there a workaround?
    --
    Shaun Wexler
    MacFOH
    http://www.macfoh.com
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Aug 26, 2004, at 10:19 AM, Shaun Wexler wrote:

    > If a NSPopUpButton is directly bound to an immutable array (no indexed
    > accessor methods), such as:
    > content =            "model.anArray"
    > contentValues =    "model.anArray.string"
    > It behaves as if the contentValues were bound like this:
    > contentValues =    "<model.anArray....>"
    > ...because the button will not create items for duplicate strings in
    > the array.  Should I file a bug?  Is there a workaround?
    >
    I'm not sure if it should be considered a bug -- if the menu titles are
    the same, how would the user discriminate between them?

    mmalc
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Aug 26, 2004, at 11:03 AM, mmalcolm crawford wrote:

    >> If a NSPopUpButton is directly bound to an immutable array (no
    >> indexed accessor methods), such as:
    >> content =            "model.anArray"
    >> contentValues =    "model.anArray.string"
    >> It behaves as if the contentValues were bound like this:
    >> contentValues =    "<model.anArray....>"
    >> ...because the button will not create items for duplicate strings in
    >> the array.  Should I file a bug?  Is there a workaround?
    >>
    > I'm not sure if it should be considered a bug -- if the menu titles
    > are the same, how would the user discriminate between them?

    Shouldn't that be up to the developer to decide?  I feel it most
    certainly IS an API bug (as well as a documentation bug).  If I have an
    array of 10 elements to display, which results in the bound
    NSPopUpButton showing only 7 items...  ahem.  If I required a
    @distinctUnionOfObjects, I would have specified a
    @distinctUnionOfObjects.  Isn't that the reason for having KVC array
    operators?

    rdar://problems/3777252

    OT:  today was the first day that Bug Reporter remembered my Apple ID
    on the web form!  Maybe someone is finally working on tuning up
    RadarWeb?  ;)
    --
    Shaun Wexler
    MacFOH
    http://www.macfoh.com
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Aug 26, 2004, at 11:03 AM, mmalcolm crawford wrote:

    > On Aug 26, 2004, at 10:19 AM, Shaun Wexler wrote:
    >
    >> If a NSPopUpButton is directly bound to an immutable array (no
    >> indexed accessor methods), such as:
    >> content =            "model.anArray"
    >> contentValues =    "model.anArray.string"
    >> It behaves as if the contentValues were bound like this:
    >> contentValues =    "<model.anArray....>"
    >> ...because the button will not create items for duplicate strings in
    >> the array.  Should I file a bug?  Is there a workaround?
    >>
    > I'm not sure if it should be considered a bug -- if the menu titles
    > are the same, how would the user discriminate between them?

    By their position in the menu? Consider a menu like this, where the app
    names are grayed out (a contrived example, I know):

    iTunes
      Play
      Pause
      Mute
    -----------
    iMovie
      Play
      Pause
      Mute
    -----------
    GarageBand
      Play
      Pause
      Mute

    _murat
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.
  • On Aug 26, 2004, at 11:32 AM, Shaun Wexler wrote:

    > On Aug 26, 2004, at 11:03 AM, mmalcolm crawford wrote:
    >
    >>> If a NSPopUpButton is directly bound to an immutable array (no
    >>> indexed accessor methods), such as:
    >>> content =            "model.anArray"
    >>> contentValues =    "model.anArray.string"
    >>> It behaves as if the contentValues were bound like this:
    >>> contentValues =    "<model.anArray....>"
    >>> ...because the button will not create items for duplicate strings in
    >>> the array.  Should I file a bug?  Is there a workaround?
    >> I'm not sure if it should be considered a bug -- if the menu titles
    >> are the same, how would the user discriminate between them?
    >
    I take that back -- I can think of situations in which there might be
    the same entry.

    > Shouldn't that be up to the developer to decide?  I feel it most
    > certainly IS an API bug (as well as a documentation bug).  If I have
    > an array of 10 elements to display, which results in the bound
    > NSPopUpButton showing only 7 items...  ahem.  If I required a
    > @distinctUnionOfObjects, I would have specified a
    > @distinctUnionOfObjects.  Isn't that the reason for having KVC array
    > operators?
    >
    I'm not sure it will be due to an array operator...

    I can't find any workaround at the moment.  I would suggest finding a
    way to ensure each string is unique.

    > rdar://problems/3777252
    >
    Please try to file different bugs in different reports (behaviour vs.
    documentation).

    mmalc
    _______________________________________________
    cocoa-dev mailing list | <cocoa-dev...>
    Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
    Do not post admin requests to the list. They will be ignored.