The index of the row the user clicked.
- macOS 10.0+
The index of the row the user clicked to trigger an action message. Returns
–1 if the user clicked in an area of the table view not occupied by table rows.
This property contains the index of the row that the user clicked. The value is
-1 when the user clicks in an area of the table view that is not occupied by table rows.
The value of this property is meaningful in the target object’s implementation of the action and double-action methods. You can also use the value to determine which contextual menu to display when the user Control-clicks in a table. Note that you should check to see if
clicked is one of the rows the user selected and if it is, perform the contextual menu operation on all of the selected rows. To see an example of using
clicked in the implementation of a contextual menu, download the DragNDropOutlineView: implementing drag and drop in an NSOutlineView sample project.