The NSIndexSet
class represents an immutable collection of unique unsigned integers, known as indexes because of the way they are used. This collection is referred to as an index set.
You use index sets in your code to store indexes into some other data structure. For example, given an NSArray
object, you could use an index set to identify a subset of objects in that array.
You should not use index sets to store an arbitrary collection of integer values because index sets store indexes as sorted ranges. This makes them more efficient than storing a collection of individual integers. It also means that each index value can only appear once in the index set.
The designated initializers of the NSIndexSet class are: initWithIndexesInRange:
and initWithIndexSet:
.
You must not subclass the NSIndexSet
class.
The mutable subclass of NSIndexSet
is NSMutableIndexSet
.