---
title: "removeObject(identicalTo:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutablearray/removeobject(identicalto:)"
---

# removeObject(identicalTo:)

Removes all occurrences of a given object in the array.

## Declaration

```swift
func removeObject(identicalTo anObject: Any)
```

## Parameters

- `anObject`: The object to remove from the array.

## Discussion

Discussion This method determines a match by comparing the address of anObject to the addresses of objects in the receiver. If the array does not contain anObject, the method has no effect (although it does incur the overhead of searching the contents).

## See Also

### Removing Objects

- [removeAllObjects()](foundation/nsmutablearray/removeallobjects().md)
- [removeLastObject()](foundation/nsmutablearray/removelastobject().md)
- [remove(_:)](foundation/nsmutablearray/remove(_:).md)
- [remove(_:in:)](foundation/nsmutablearray/remove(_:in:).md)
- [removeObject(at:)](foundation/nsmutablearray/removeobject(at:).md)
- [removeObjects(at:)](foundation/nsmutablearray/removeobjects(at:).md)
- [removeObject(identicalTo:in:)](foundation/nsmutablearray/removeobject(identicalto:in:).md)
- [removeObjects(fromIndices:numIndices:)](foundation/nsmutablearray/removeobjects(fromindices:numindices:).md)
- [removeObjects(in:)](foundation/nsmutablearray/removeobjects(in:)-4yb26.md)
- [removeObjects(in:)](foundation/nsmutablearray/removeobjects(in:)-1udmn.md)
