<!--
{
  "availability" : [
    "iOS: 2.0.0 - 4.0.0",
    "iPadOS: 2.0.0 - 4.0.0",
    "tvOS: 9.0.0 - 9.0.0",
    "visionOS: 1.0.0 - 1.0.0",
    "watchOS: 2.0.0 - 2.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMutableArray/removeObjects(fromIndices:numIndices:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMutableArray(im)removeObjectsFromIndices:numIndices:"
  },
  "title" : "removeObjects(fromIndices:numIndices:)"
}
-->

# removeObjects(fromIndices:numIndices:)

Removes the specified number of objects from the array, beginning at the specified index.

```
func removeObjects(fromIndices indices: UnsafeMutablePointer<Int>, numIndices cnt: Int)
```

## Parameters

`indices`

A C array of the indices of the objects to remove from the receiving array.

`cnt`

The number of objects to remove from the receiving array.

## Discussion

This method is similar to [`removeObject(at:)`](/documentation/Foundation/NSMutableArray/removeObject(at:)), but it allows you to efficiently remove multiple objects with a single operation. If you sort the list of indexes in ascending order, you will improve the speed of this operation.

This method cannot be sent to a remote object with distributed objects.

### Special Considerations

This deprecated method uses a C array of indices. The [`removeObjects(at:)`](/documentation/Foundation/NSMutableArray/removeObjects(at:)) method uses an [`NSIndexSet`](/documentation/Foundation/NSIndexSet) which provides a more efficient way of indexing into an array.

## See Also

[`-  initWithCapacity:`](/documentation/Foundation/NSMutableArray/init(capacity:))

Returns an array, initialized with enough memory to initially hold a given number of objects.



---

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)