---
title: "init(indexes:length:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsindexpath/init(indexes:length:)"
---

# init(indexes:length:)

Initializes an index path with the given nodes and length.

## Declaration

```swift
init(indexes: UnsafePointer<Int>?, length: Int)
```

## Parameters

- `indexes`: Array of indexes to make up the index path.
- `length`: Number of nodes to include in the index path.

## Return Value

Return Value Initialized NSIndexPath object with indexes up to length.

## Discussion

Discussion This method is a designated initializer of NSIndexPath.

## See Also

### Creating and Initializing Index Paths

- [init(index:)](foundation/nsindexpath/init(index:).md)
