<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableViewDelegate/tableView(_:nextTypeSelectMatchFromRow:toRow:for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSTableViewDelegate(im)tableView:nextTypeSelectMatchFromRow:toRow:forString:"
  },
  "title" : "tableView(_:nextTypeSelectMatchFromRow:toRow:for:)"
}
-->

# tableView(_:nextTypeSelectMatchFromRow:toRow:for:)

Asks the delegate for the row within the specified search range that matches the specified string.

```
@MainActor optional func tableView(_ tableView: NSTableView, nextTypeSelectMatchFromRow startRow: Int, toRow endRow: Int, for searchString: String) -> Int
```

## Parameters

`tableView`

The table view that sent the message.

`startRow`

The starting row of the search range.

`endRow`

The ending row of the search range.

`searchString`

A string containing the typed selection.

## Return Value

The first row in the range of `startRow` through `endRow` (excluding `endRow` itself) that matches `selectionString`. Return `-1` if no match is found.

## Discussion

Use this method to control how type selection works in a table. (Implementation of this method isn’t required to support type selection.) Note that it’s possible for `endRow` to be less than `startRow` if the search will wrap.

---

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)