<!--
{
  "availability" : [
    "iOS: 7.1.0 -",
    "iPadOS: 7.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.2 -",
    "tvOS: 7.1.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 5.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaPlayer",
  "identifier" : "/documentation/MediaPlayer/MPRemoteCommand/removeTarget(_:action:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Player"
    ],
    "preciseIdentifier" : "c:objc(cs)MPRemoteCommand(im)removeTarget:action:"
  },
  "title" : "removeTarget(_:action:)"
}
-->

# removeTarget(_:action:)

Removes a target and action from a remote command object.

```
func removeTarget(_ target: Any, action: Selector?)
```

## Parameters

`target`

The object that currently is a recipient of action messages sent by this object. Specify `nil` to remove all targets.

`action`

A selector identifying a method on the target. Specify `NULL` to remove all actions.

## Discussion

Call the [`removeTarget(_:action:)`](/documentation/MediaPlayer/MPRemoteCommand/removeTarget(_:action:)) method to remove the specified target-action pair. Passing `nil` for `target` matches all targets and passing `NULL` for `action` matches all actions.

---

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)