---
title: objectEnumerator()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsmaptable/objectenumerator()
---

# objectEnumerator()

Returns an enumerator object that lets you access each value in the map table.

## Declaration

```swift
func objectEnumerator() -> NSEnumerator?
```

## Return Value

Return Value An enumerator object that lets you access each value in the map table.

## Discussion

Discussion The following code fragment illustrates how you might use the method. NSEnumerator *enumerator = [myMapTable objectEnumerator]; id value;   while ((value = [enumerator nextObject])) {     /* code that acts on the map table's values */ } Special Considerations It is more efficient to use the fast enumeration protocol (see NSFastEnumeration).

## See Also

### Accessing Content

- [object(forKey:)](foundation/nsmaptable/object(forkey:).md)
- [keyEnumerator()](foundation/nsmaptable/keyenumerator().md)
- [count](foundation/nsmaptable/count.md)
