---
title: "init(forRow:inSection:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsindexpath/init(forrow:insection:)"
---

# init(forRow:inSection:)

Initializes an index path with the indexes of a specific row and section in a table view.

## Declaration

```swift
convenience init(forRow row: Int, inSection section: Int)
```

```swift
convenience init(row: Int, section: Int)
```

## Parameters

- `row`: An index number identifying a row in a doc://com.apple.documentation/documentation/UIKit/UITableView object in a section identified by section.
- `section`: An index number identifying a section in a doc://com.apple.documentation/documentation/UIKit/UITableView object.

## Return Value

Return Value An NSIndexPath object.

## See Also

### Using Special Node Names

- [init(forItem:inSection:)](foundation/nsindexpath/init(foritem:insection:).md)
- [section](foundation/nsindexpath/section.md)
- [row](foundation/nsindexpath/row.md)
- [item](foundation/nsindexpath/item.md)
