NSIndex with discontinuous values

  • I need to select, in one shot only, some rows of my table view with

        [tV selectRowIndexes:indexSet byExtendingSelection:NO];

    The rows are discontinuous, as 1, 4, 6, 7, 14, 23...
    So I have to create a discontinuous NSIndexSet. I can't see any way to do
    that. Have you any idea?

    Best Regards
    --
    Lorenzo
    email: <archidea...>
  • On 22 Nov 2007, at 10:26, Lorenzo wrote:

    > I need to select, in one shot only, some rows of my table view with
    >
    > [tV selectRowIndexes:indexSet byExtendingSelection:NO];
    >
    > The rows are discontinuous, as 1, 4, 6, 7, 14, 23...
    > So I have to create a discontinuous NSIndexSet. I can't see any way
    > to do
    > that. Have you any idea?

    NSMutableIndexSet's -addIndex:, -addIndexes: or -addIndexesInRange:
    methods?

    Kind regards,

    Alastair.

    --
    http://alastairs-place.net
  • On Nov 22, 2007 2:26 AM, Lorenzo <archidea...> wrote:
    > I need to select, in one shot only, some rows of my table view with
    >
    > [tV selectRowIndexes:indexSet byExtendingSelection:NO];
    >
    > The rows are discontinuous, as 1, 4, 6, 7, 14, 23...
    > So I have to create a discontinuous NSIndexSet. I can't see any way to do
    > that. Have you any idea?

    NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
    [indexSet addIndex: 1];
    [indexSet addIndex: 4];
    [indexSet addIndex: 6];
    [indexSet addIndex: ...];
    etc.

    --
    Clark S. Cox III
    <clarkcox3...>
previous month november 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    
Go to today