---
title: "CFDictionaryGetKeysAndValues(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfdictionarygetkeysandvalues(_:_:_:)"
---

# CFDictionaryGetKeysAndValues(_:_:_:)

Fills two buffers with the keys and values from a dictionary.

## Declaration

```swift
func CFDictionaryGetKeysAndValues(_ theDict: CFDictionary!, _ keys: UnsafeMutablePointer<UnsafeRawPointer?>!, _ values: UnsafeMutablePointer<UnsafeRawPointer?>!)
```

## Parameters

- `theDict`: The dictionary to examine.
- `keys`: A C array of pointer-sized values that, on return, is filled with keys from the theDict. The keys and values C arrays are parallel to each other (that is, the items at the same indices form a key-value pair from the dictionary). This value must be a valid pointer to a C array of the appropriate type and size (that is, a size equal to the count of theDict), or NULL if the keys are not required. If the keys are Core Foundation objects, ownership follows the https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-SW1.
- `values`: A C array of pointer-sized values that, on return, is filled with values from the theDict. The keys and values C arrays are parallel to each other (that is, the items at the same indices form a key-value pair from the dictionary). This value must be a valid pointer to a C array of the appropriate type and size (that is, a size equal to the count of theDict), or NULL if the values are not required. If the values are Core Foundation objects, ownership follows the https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html#//apple_ref/doc/uid/20001148-SW1.

## See Also

### Examining a dictionary

- [CFDictionaryContainsKey(_:_:)](corefoundation/cfdictionarycontainskey(_:_:).md)
- [CFDictionaryContainsValue(_:_:)](corefoundation/cfdictionarycontainsvalue(_:_:).md)
- [CFDictionaryGetCount(_:)](corefoundation/cfdictionarygetcount(_:).md)
- [CFDictionaryGetCountOfKey(_:_:)](corefoundation/cfdictionarygetcountofkey(_:_:).md)
- [CFDictionaryGetCountOfValue(_:_:)](corefoundation/cfdictionarygetcountofvalue(_:_:).md)
- [CFDictionaryGetValue(_:_:)](corefoundation/cfdictionarygetvalue(_:_:).md)
- [CFDictionaryGetValueIfPresent(_:_:_:)](corefoundation/cfdictionarygetvalueifpresent(_:_:_:).md)
