The index set fills an index buffer with the indexes contained both in the index set and in an index range, returning the number of indexes copied.
- iOS 2.0+
- macOS 10.3+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
Index buffer to fill.
Maximum size of
Index range to compare with indexes in the index set;
nilrepresents all the indexes in the index set. Indexes in the index range and in the index set are copied to
index. On output, the range of indexes not copied to
Number of indexes placed in
You are responsible for allocating the memory required for
index and for releasing it later.
Suppose you have an index set with contiguous indexes from 1 to 100. If you use this method to request a range of
(1, 100)—which represents the set of indexes 1 through 100—and specify a buffer size of
20, this method returns 20 indexes—1 through 20—in
index and sets
(21, 80)—which represents the indexes 21 through 100.
Use this method to retrieve entries quickly and efficiently from an index set. You can call this method repeatedly to retrieve blocks of index values and then process them. When doing so, use the return value and
index to determine when you have finished processing the desired indexes. When the return value is less than
buffer, you have reached the end of the range.