---
title: "dragImageForRows:event:dragImageOffset:"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstableview/dragimageforrows:event:dragimageoffset:"
---

# dragImageForRows:event:dragImageOffset:

Computes and returns an image to use for dragging.

## Declaration

```occ
- (NSImage *) dragImageForRows:(NSArray *) dragRows event:(NSEvent *) dragEvent dragImageOffset:(NSPointPointer) dragImageOffset;
```

## Discussion

Discussion Override this to return a custom image. dragRows represents the rows participating in the drag. dragEvent is a reference to the mouse-down event that began the drag. dragImageOffset is an in/out parameter. This method is called with dragImageOffset set to NSZeroPoint, but it can be modified to reposition the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the cursor. note: To support multi-item drags, it is highly recommended to implement the delegate method tableView(_:pasteboardWriterForRow:) instead. Using that method will cause this method to not be called.

## See Also

### Deprecated Methods

- [setAutoresizesAllColumnsToFit:](appkit/nstableview/setautoresizesallcolumnstofit:.md)
- [autoresizesAllColumnsToFit](appkit/nstableview/autoresizesallcolumnstofit.md)
- [selectColumn:byExtendingSelection:](appkit/nstableview/selectcolumn:byextendingselection:.md)
- [selectRow:byExtendingSelection:](appkit/nstableview/selectrow:byextendingselection:.md)
- [tableView:writeRows:toPasteboard:](objectivec/nsobject-swift.class/tableview:writerows:topasteboard:.md)
- [setDrawsGrid:](appkit/nstableview/setdrawsgrid:.md)
- [drawsGrid](appkit/nstableview/drawsgrid.md)
- [selectedColumnEnumerator](appkit/nstableview/selectedcolumnenumerator.md)
- [selectedRowEnumerator](appkit/nstableview/selectedrowenumerator.md)
- [focusedColumn()](appkit/nstableview/focusedcolumn().md)
- [setFocusedColumn(_:)](appkit/nstableview/setfocusedcolumn(_:).md)
- [shouldFocusCell(_:atColumn:row:)](appkit/nstableview/shouldfocuscell(_:atcolumn:row:).md)
- [performClickOnCell(atColumn:row:)](appkit/nstableview/performclickoncell(atcolumn:row:).md)
- [preparedCell(atColumn:row:)](appkit/nstableview/preparedcell(atcolumn:row:).md)
- [columnsInRect:](appkit/nstableview/columnsinrect:.md)
