Cocoa NSIndexSet : Multiple Indexes. How to create the index set, multiple indexes?

If the indexes are consecutive like in your example, you can use this:

NSIndexSet *indexSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, 3)];

If not, create a mutable index set and add the indexes (or ranges) one by one:

NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
[indexSet addIndex:3];
[indexSet addIndex:5];
[indexSet addIndex:8];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)