Confused about setting selection in NSBrowser

  • I'm trying to set the selected item in an NSBrowser.

    I don't want to use setPath: because the items I'm storing in the browser are not unique, so therefore paths are not unique.

    I'm trying to use setIndexPath: but when I try the program throws an exception:

    HIToolbox: ignoring exception 'setSelectionIndexPath: is not supported for browsers with matrix delegates.' that raised inside Carbon event dispatch
    (
    0  CoreFoundation                      0x00007fff80322444 __exceptionPreprocess + 180
    1  libobjc.A.dylib                    0x00007fff8055d0f3 objc_exception_throw + 45
    2  AppKit                              0x00007fff8378e252 -[NSBrowser setSelectionIndexPath:] + 128

    I don't understand what this exception means.

          __________________________________________________________________________________
    See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/
  • On Jan 14, 2010, at 9:56 PM, Chris Idou wrote:

    > I'm trying to set the selected item in an NSBrowser.
    >
    > I don't want to use setPath: because the items I'm storing in the browser are not unique, so therefore paths are not unique.
    >
    > I'm trying to use setIndexPath: but when I try the program throws an exception:
    >
    > HIToolbox: ignoring exception 'setSelectionIndexPath: is not supported for browsers with matrix delegates.' that raised inside Carbon event dispatch
    > (
    > 0  CoreFoundation                      0x00007fff80322444 __exceptionPreprocess + 180
    > 1  libobjc.A.dylib                    0x00007fff8055d0f3 objc_exception_throw + 45
    > 2  AppKit                              0x00007fff8378e252 -[NSBrowser setSelectionIndexPath:] + 128
    >
    > I don't understand what this exception means.

    Are you building against 10.6 SDK?

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
  • On Jan 15, 2010, at 8:07 AM, Keary Suska wrote:

    > On Jan 14, 2010, at 9:56 PM, Chris Idou wrote:
    >
    >> I'm trying to set the selected item in an NSBrowser.
    >>
    >> I don't want to use setPath: because the items I'm storing in the browser are not unique, so therefore paths are not unique.
    >>
    >> I'm trying to use setIndexPath: but when I try the program throws an exception:
    >>
    >> HIToolbox: ignoring exception 'setSelectionIndexPath: is not supported for browsers with matrix delegates.' that raised inside Carbon event dispatch
    >> (
    >> 0  CoreFoundation                      0x00007fff80322444 __exceptionPreprocess + 180
    >> 1  libobjc.A.dylib                    0x00007fff8055d0f3 objc_exception_throw + 45
    >> 2  AppKit                              0x00007fff8378e252 -[NSBrowser setSelectionIndexPath:] + 128
    >>
    >> I don't understand what this exception means.
    >
    > Are you building against 10.6 SDK?

    Chris must be, otherwise he would have warnings.

    Chris -- read up about the "item based" browser in the NSBrowser.h header.

    corbin
  • Yes, I'm doing 10.6. But I don't see anything about "item based" in NSBrowser.h, nor anything else that looks enlightening.

    ________________________________
    From: Corbin Dunn <corbind...>
    To: Keary Suska <cocoa-dev...>
    Cc: Chris Idou <idou747...>; <cocoa-dev...>
    Sent: Sat, 16 January, 2010 3:17:00 AM
    Subject: Re: Confused about setting selection in NSBrowser

    On Jan 15, 2010, at 8:07 AM, Keary Suska wrote:

    > On Jan 14, 2010, at 9:56 PM, Chris Idou wrote:
    >
    >> I'm trying to set the selected item in an NSBrowser.
    >>
    >> I don't want to use setPath: because the items I'm storing in the browser are not unique, so therefore paths are not unique.
    >>
    >> I'm trying to use setIndexPath: but when I try the program throws an exception:
    >>
    >> HIToolbox: ignoring exception 'setSelectionIndexPath: is not supported for browsers with matrix delegates.' that raised inside Carbon event dispatch
    >> (
    >> 0  CoreFoundation                      0x00007fff80322444 __exceptionPreprocess + 180
    >> 1  libobjc.A.dylib                    0x00007fff8055d0f3 objc_exception_throw + 45
    >> 2  AppKit                              0x00007fff8378e252 -[NSBrowser setSelectionIndexPath:] + 128
    >>
    >> I don't understand what this exception means.
    >
    > Are you building against 10.6 SDK?

    Chris must be, otherwise he would have warnings.

    Chris -- read up about the "item based" browser in the NSBrowser.h header.

    corbin

          __________________________________________________________________________________
    See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/