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

# tableView(_:shouldEdit:row:)

Asks the delegate if the cell at the specified row and column can be edited.

```
@MainActor optional func tableView(_ tableView: NSTableView, shouldEdit tableColumn: NSTableColumn?, row: Int) -> Bool
```

## Parameters

`tableView`

The table view that sent the message.

`tableColumn`

The table column.

`row`

The row index.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> to allow editing the cell, <doc://com.apple.documentation/documentation/Swift/false> to deny editing.

## Discussion

The delegate can implement this method to disallow editing of specific cells.

> Note:
> This method is only valid for ``doc://com.apple.appkit/documentation/AppKit/NSCell``-based table views.

---

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)