---
title: iterateObjects
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osdictionary/iterateobjects-9h89s
---

# iterateObjects

Iterates the dictionary calling a callback block for each member.

## Declaration

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

## Parameters

- `block`: The block to invoke.

## Return Value

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

## Discussion

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.

## See Also

### Accessing Keys and Values

- [getObject](driverkit/osdictionary/getobject-9ikoz.md)
- [getObject](driverkit/osdictionary/getobject-8k3ie.md)
- [setObject](driverkit/osdictionary/setobject-9b4z0.md)
- [setObject](driverkit/osdictionary/setobject-7q0u2.md)
- [removeObject](driverkit/osdictionary/removeobject-25qm5.md)
- [removeObject](driverkit/osdictionary/removeobject-156jh.md)
- [iterateObjects](driverkit/osdictionary/iterateobjects-6cv0d.md)
- [OSDictionaryIterateObjectsBlock](driverkit/osdictionaryiterateobjectsblock.md)
- [OSDictionaryIterateObjectsCallback](driverkit/osdictionaryiterateobjectscallback.md)
