When data is dragged onto a NSTableView
configured as a drop destination, it can be dropped above or on top of a row. Sometimes, it may be preferable to highlight the entire table when a drag enters its bounds, as shown below.
To accomplish this, set your drop row to -1
in the -tableView:validateDrop:proposedRow:proposedDropOperation:
method, which is a part of the NSTableViewDataSource
protocol.
- (NSDragOperation)tableView:(NSTableView *)tableView
validateDrop:(id < NSDraggingInfo >)info
proposedRow:(NSInteger)row
proposedDropOperation:(NSTableViewDropOperation)dropOperation {
[tableView setDropRow:-1 dropOperation:NSTableViewDropOn];
return NSDragOperationEvery;
}