<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/OSDictionary/iterateObjects-9h89s",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@OSDictionary@F@iterateObjects#BFb(#*$@S@OSObject#S2_)#1"
  },
  "title" : "iterateObjects"
}
-->

# iterateObjects

Iterates the dictionary calling a callback block for each member.

```
bool iterateObjects(OSDictionaryIterateObjectsBlock block) const;
```

## Parameters

`block`

The block to invoke.

## Return Value

false if the callback block returned false, otherwise true (including if the dictionary is empty).

## Discussion

Calls the block with each value in the dictionary. The block must not modify the dictionary during iteration. If the block returns true the iteration continues for all members, returning false halts the iteration early.

---

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)