<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSArray/enumerateObjects(options:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSArray(im)enumerateObjectsWithOptions:usingBlock:"
  },
  "title" : "enumerateObjects(options:using:)"
}
-->

# enumerateObjects(options:using:)

Executes a given closure or block using each object in the array with the specified options.

```
func enumerateObjects(options opts: NSEnumerationOptions = [], using block: (Any, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
```

## Parameters

`opts`

The options for the enumeration. For possible values, see [`NSEnumerationOptions`](/documentation/Foundation/NSEnumerationOptions).

`block`

A closure or block to execute for each object in the array, taking three arguments:

- The object.
- The index of the object in the array.
- A reference to a Boolean value, which the closure can set to <doc://com.apple.documentation/documentation/Swift/true> in order to stop further enumeration of the array. If a closure stops further enumeration, that closure continues to run until it’s finished. When the [`concurrent`](/documentation/Foundation/NSEnumerationOptions/concurrent) enumeration option is specified, enumeration stops after all of the currently running closures finish.

## Discussion

This method executes synchronously. By default, the enumeration starts with the first object and continues serially through the array to the last object. You can specify [`concurrent`](/documentation/Foundation/NSEnumerationOptions/concurrent) and/or [`reverse`](/documentation/Foundation/NSEnumerationOptions/reverse) as enumeration options to modify this behavior.

## See Also

[`makeObjectsPerformSelector:`](/documentation/Foundation/NSArray/makeObjectsPerformSelector:)

Sends to each object in the array the message identified by a given selector, starting with the first object and continuing through the array to the last object.

[`makeObjectsPerformSelector:withObject:`](/documentation/Foundation/NSArray/makeObjectsPerformSelector:withObject:)

Sends the `aSelector` message to each object in the array, starting with the first object and continuing through the array to the last object.



---

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)