<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMutableOrderedSet/removeObjects(in:)-8h2kh",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMutableOrderedSet(im)removeObjectsInArray:"
  },
  "title" : "removeObjects(in:)"
}
-->

# removeObjects(in:)

Removes the objects in the array from the mutable ordered set.

```
func removeObjects(in array: [Any])
```

## Parameters

`array`

An array containing the objects to be removed from the receiving mutable ordered set.

## Discussion

This method is similar to [`remove(_:)`](/documentation/Foundation/NSMutableOrderedSet/remove(_:)), but allows you to efficiently remove large sets of objects with a single operation. If the receiving mutable ordered set does not contain objects in array, the method has no effect (although it does incur the overhead of searching the contents).

This method assumes that all elements in array respond to <doc://com.apple.documentation/documentation/ObjectiveC/NSObjectProtocol/hash> and <doc://com.apple.documentation/documentation/ObjectiveC/NSObjectProtocol/isEqual(_:)>.

---

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)