<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/NSObject-swift.class/cancelPreviousPerformRequests(withTarget:selector:object:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Objective-C Runtime",
      "ObjectiveC"
    ],
    "preciseIdentifier" : "c:objc(cs)NSObject(cm)cancelPreviousPerformRequestsWithTarget:selector:object:"
  },
  "title" : "cancelPreviousPerformRequests(withTarget:selector:object:)"
}
-->

# cancelPreviousPerformRequests(withTarget:selector:object:)

Cancels perform requests previously registered with [`perform(_:with:afterDelay:)`](/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:)).

```
class func cancelPreviousPerformRequests(withTarget aTarget: Any, selector aSelector: Selector, object anArgument: Any?)
```

## Parameters

`aTarget`

The target for requests previously registered with the [`perform(_:with:afterDelay:)`](/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:)) instance method

`aSelector`

The [Selector](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Selector.html#//apple_ref/doc/uid/TP40008195-CH48) for requests previously registered with the [`perform(_:with:afterDelay:)`](/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:)) instance method.

`anArgument`

The argument for requests previously registered with the [`perform(_:with:afterDelay:)`](/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:)) instance method. Argument equality is determined using [`isEqual(_:)`](/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:)), so the value need not be the same object that was passed originally. Pass `nil` to match a request for `nil` that was originally passed as the argument.

## Discussion

All perform requests are canceled that have the same target as `aTarget`, argument as `anArgument`, and selector as `aSelector`. This method removes perform requests only in the current run loop, not all run loops.

---

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)