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

# setDropRow(_:dropOperation:)

Retargets the proposed drop operation.

```
func setDropRow(_ row: Int, dropOperation: NSTableView.DropOperation)
```

## Parameters

`row`

The target row index.

`dropOperation`

The drop operation. Supported values are specified by [`NSTableView.DropOperation`](/documentation/AppKit/NSTableView/DropOperation).

## Discussion

For example, to specify a drop on the second row, specify `row` as 1, and `operation` as `NSTableViewDropOn`. To specify a drop below the last row, specify `row` as `[self numberOfRows]` and `operation` as `NSTableViewDropAbove`.

Passing a value of `–1` for `row` and `NSTableViewDropOn` as the `operation` causes the entire table view to be highlighted rather than a specific row. This is useful if the data displayed by the table view does not allow the user to drop items at a specific row location.

---

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)