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

# sendAction()

If the selected cell has both an action and a target, sends its action to its target.

```
func sendAction() -> Bool
```

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if an action was successfully sent to a target. If the selected cell is disabled, this method does nothing and returns <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

If the cell has an action but no target, its action is sent to the target of the receiver. If the cell doesn’t have an action, or if there is no selected cell, the receiver sends its own action to its target.

## See Also

[`var action: Selector?`](/documentation/AppKit/NSCell/action)

The action performed by the cell.

[`var target: AnyObject?`](/documentation/AppKit/NSCell/target)

The object that receives the cell’s action messages.



---

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)