Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
13 NSMutableIndexSet *indexSet = 14 [NSMutableIndexSet indexSetWithIndex: 1]; 15 [indexSet addIndexesInRange: 16 NSMakeRange(5, 20)]; 17 [array removeObjectsAtIndexes: 18 indexSet]; |
Arrays are indexed by integers. Often, you want to do some operation on a group of values in an array. A special class, called NSIndexSet, is used for storing groups of indexes. Internally, this stores a set of ranges, so can be quite dense.