---
title: "getIndexes(_:range:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsindexpath/getindexes(_:range:)"
---

# getIndexes(_:range:)

Copies the indexes stored in the index path from the positions specified by the position range into the specified indexes.

## Declaration

```swift
func getIndexes(_ indexes: UnsafeMutablePointer<Int>, range positionRange: NSRange)
```

## Parameters

- `indexes`: Pointer to a C array of at least as many doc://com.apple.documentation/documentation/ObjectiveC/NSUInteger objects as specified by the length of positionRange. On return, the array holds the index path’s indexes.
- `positionRange`: A range of valid positions within the index path. If the location plus the length of positionRange is greater than the length of the index path, this method raises an doc://com.apple.foundation/documentation/Foundation/NSExceptionName/rangeException.

## Discussion

Discussion You must allocate the memory for the C array.

## See Also

### Working with Indexes

- [index(atPosition:)](foundation/nsindexpath/index(atposition:).md)
- [getIndexes(_:)](foundation/nsindexpath/getindexes(_:).md)
