<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/UndoManager/removeAllActions(withTarget:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUndoManager(im)removeAllActionsWithTarget:"
  },
  "title" : "removeAllActions(withTarget:)"
}
-->

# removeAllActions(withTarget:)

Clears the undo and redo stacks of all operations involving the specified target as the recipient of the undo message.

```
func removeAllActions(withTarget target: Any)
```

## Parameters

`target`

The recipient of the undo messages to be removed.

## Discussion

Doesn’t re-enable the manager if it’s disabled.

## See Also

[`-  enableUndoRegistration`](/documentation/Foundation/UndoManager/enableUndoRegistration())

Enables the recording of undo operations.



---

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)