<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "swift: -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSIndexPath/init(forRow:inSection:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSIndexPath(cm)indexPathForRow:inSection:"
  },
  "title" : "init(forRow:inSection:)"
}
-->

# init(forRow:inSection:)

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

```
convenience init(forRow row: Int, inSection 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

An [`NSIndexPath`](/documentation/Foundation/NSIndexPath) object.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)