---
title: "cancelPreviousPerformRequests(withTarget:selector:object:)"
framework: objectivec
role: symbol
role_heading: Type Method
path: "objectivec/nsobject-swift.class/cancelpreviousperformrequests(withtarget:selector:object:)"
---

# cancelPreviousPerformRequests(withTarget:selector:object:)

Cancels perform requests previously registered with perform(_:with:afterDelay:).

## Declaration

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

## Parameters

- `aTarget`: The target for requests previously registered with the doc://com.apple.objectivec/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:) instance method
- `aSelector`: The 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 doc://com.apple.objectivec/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:) instance method.
- `anArgument`: The argument for requests previously registered with the doc://com.apple.objectivec/documentation/ObjectiveC/NSObject-swift.class/perform(_:with:afterDelay:) instance method. Argument equality is determined using doc://com.apple.objectivec/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

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.

## See Also

### Sending Messages

- [perform(_:with:afterDelay:)](objectivec/nsobject-swift.class/perform(_:with:afterdelay:).md)
- [perform(_:with:afterDelay:inModes:)](objectivec/nsobject-swift.class/perform(_:with:afterdelay:inmodes:).md)
- [performSelector(onMainThread:with:waitUntilDone:)](objectivec/nsobject-swift.class/performselector(onmainthread:with:waituntildone:).md)
- [performSelector(onMainThread:with:waitUntilDone:modes:)](objectivec/nsobject-swift.class/performselector(onmainthread:with:waituntildone:modes:).md)
- [perform(_:on:with:waitUntilDone:)](objectivec/nsobject-swift.class/perform(_:on:with:waituntildone:).md)
- [perform(_:on:with:waitUntilDone:modes:)](objectivec/nsobject-swift.class/perform(_:on:with:waituntildone:modes:).md)
- [performSelector(inBackground:with:)](objectivec/nsobject-swift.class/performselector(inbackground:with:).md)
- [cancelPreviousPerformRequests(withTarget:)](objectivec/nsobject-swift.class/cancelpreviousperformrequests(withtarget:).md)
