<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/tableView:writeRows:toPasteboard:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(im)tableView:writeRows:toPasteboard:"
  },
  "title" : "tableView:writeRows:toPasteboard:"
}
-->

# tableView:writeRows:toPasteboard:

Writes the specified rows to the specified pasteboard.

```
- (BOOL) tableView:(NSTableView *) tableView writeRows:(NSArray *) rows toPasteboard:(NSPasteboard *) pboard;
```

## Parameters

`tableView`

The table view.

`rows`

An array of row indexes.

`pboard`

The pasteboard.

## Return Value

Return [`YES`](/documentation/ObjectiveC/YES) to allow the drag: otherwise [`NO`](/documentation/ObjectiveC/NO) to refuse the drag.

## Discussion

Invoked by `aTableView` after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return [`NO`](/documentation/ObjectiveC/NO). To start a drag, return [`YES`](/documentation/ObjectiveC/YES) and place the drag data onto `pboard` (data, owner, and so on). The drag image and other drag-related information will be set up and provided by the table view once this call returns with [`YES`](/documentation/ObjectiveC/YES). `rows` is the list of row numbers that will be participating in the drag.

---

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)