Instance Method

initWithIndexesInRange:

Initializes an allocated NSIndexSet object with an index range.

Declaration

- (instancetype)initWithIndexesInRange:(NSRange)range;

Parameters

indexRange

An index range. Must be in the range 0 .. NSNotFound - 1..

Return Value

Initialized NSIndexSet object with indexRange.

Discussion

This method raises an NSRangeException when indexRange would add an index that exceeds the maximum allowed value for unsigned integers.

The resulting index set has a firstIndex equal to the location of indexRange, and a count equal to the length of indexRange. Specifying a zero-length range results in an empty index set.

This method is a designated initializer for NSIndexSet.

See Also

Creating Index Sets

+ indexSet

Creates an empty index set.

+ indexSetWithIndex:

Creates an index set with an index.

+ indexSetWithIndexesInRange:

Creates an index set with an index range.

- init

Initializes an allocated NSIndexSet object.

- initWithIndex:

Initializes an allocated NSIndexSet object with an index.

- initWithIndexSet:

Initializes an allocated NSIndexSet object with an index set.