<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableView/editColumn(_:row:with:select:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableView(im)editColumn:row:withEvent:select:"
  },
  "title" : "editColumn(_:row:with:select:)"
}
-->

# editColumn(_:row:with:select:)

Edits the cell at the specified column and row using the specified event and selection behavior.

```
func editColumn(_ column: Int, row: Int, with event: NSEvent?, select: Bool)
```

## Parameters

`column`

The index of the column in the [`tableColumns`](/documentation/AppKit/NSTableView/tableColumns) array.

`row`

The row index.

`event`

The event.

`select`

<doc://com.apple.documentation/documentation/Swift/true> if the entered contents should be selected, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method is invoked automatically in response to user actions; you should rarely need to invoke it directly. `theEvent` is usually the mouse event that triggered editing; it can be `nil` when starting an edit programmatically.

This method scrolls the table view so that the cell is visible and sets up the field editor. If `flag` is <doc://com.apple.documentation/documentation/Swift/false>, it calls the  [`edit(withFrame:in:editor:delegate:event:)`](/documentation/AppKit/NSCell/edit(withFrame:in:editor:delegate:event:)) method of the field editor’s [`NSCell`](/documentation/AppKit/NSCell) object, providing the `NSTableView` as the text delegate. If `flag` is <doc://com.apple.documentation/documentation/Swift/true>, this method calls the [`select(withFrame:in:editor:delegate:start:length:)`](/documentation/AppKit/NSCell/select(withFrame:in:editor:delegate:start:length:)) method instead.

This method can be overridden to customize drawing for `rowIndex` when using [`NSCell`](/documentation/AppKit/NSCell)-based table views.

> Note:
> When using ``doc://com.apple.appkit/documentation/AppKit/NSView``-based table views, this method attempts to make the view at the specified `column` and `row` the first responder, which will begin editing if the view supports editing. This method should not be subclassed or overridden for ``doc://com.apple.appkit/documentation/AppKit/NSView``-based table views. Instead, row drawing customization can be done by subclassing ``doc://com.apple.appkit/documentation/AppKit/NSTableRowView``.

---

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)