---
title: iterateObjects
framework: driverkit
role: symbol
role_heading: Instance Method
path: driverkit/osdictionary/iterateobjects-6cv0d
---

# iterateObjects

Iterates the dictionary calling a callback block for each member.

## Declaration

```occ
virtual bool iterateObjects(OSCollectionIterateObjectsBlock block) const;
```

## Parameters

- `block`: The block to invoke.

## Return Value

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

## Discussion

Discussion Calls the block with each member of the dictionary. The block must not dictionary the array during iteration. If the block returns true the iteration continues for all members, returning false halts the iteration early. OSDictionary also has a dictionary specific iterateObjects() which supplies the key and value to the callback.

## 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-9h89s.md)
- [OSDictionaryIterateObjectsBlock](driverkit/osdictionaryiterateobjectsblock.md)
- [OSDictionaryIterateObjectsCallback](driverkit/osdictionaryiterateobjectscallback.md)
