---
title: "removeObjects(fromIndices:numIndices:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutablearray/removeobjects(fromindices:numindices:)"
---

# removeObjects(fromIndices:numIndices:)

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

## Declaration

```swift
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

Discussion This method is similar to 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:) method uses an NSIndexSet which provides a more efficient way of indexing into an array.

## See Also

### Related Documentation

- [init(capacity:)](foundation/nsmutablearray/init(capacity:).md)

### 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:)](foundation/nsmutablearray/removeobject(identicalto:).md)
- [removeObject(identicalTo:in:)](foundation/nsmutablearray/removeobject(identicalto:in:).md)
- [removeObjects(in:)](foundation/nsmutablearray/removeobjects(in:)-4yb26.md)
- [removeObjects(in:)](foundation/nsmutablearray/removeobjects(in:)-1udmn.md)
