---
title: "xpc_dictionary_get_dictionary(_:_:)"
framework: xpc
role: symbol
role_heading: Function
path: "xpc/xpc_dictionary_get_dictionary(_:_:)"
---

# xpc_dictionary_get_dictionary(_:_:)

Returns the dictionary value for the specified key.

## Declaration

```swift
func xpc_dictionary_get_dictionary(_ xdict: xpc_object_t, _ key: UnsafePointer<CChar>) -> xpc_object_t?
```

## Parameters

- `xdict`: The dictionary object which is to be examined.
- `key`: The key whose value is to be obtained.

## Return Value

Return Value The object for the specified key within the dictionary. NULL if there is no value associated with the specified key, if the given object was not an XPC dictionary, or if the object for the specified key is not a dictionary.

## Discussion

Discussion This method does not grant the caller a reference to the underlying object, so the caller is not responsible for releasing the object.

## See Also

### Dictionary objects

- [XPCDictionary](xpc/xpcdictionary.md)
- [xpc_dictionary_create(_:_:_:)](xpc/xpc_dictionary_create(_:_:_:).md)
- [xpc_dictionary_create_empty()](xpc/xpc_dictionary_create_empty().md)
- [xpc_dictionary_create_connection(_:_:)](xpc/xpc_dictionary_create_connection(_:_:).md)
- [xpc_dictionary_create_reply(_:)](xpc/xpc_dictionary_create_reply(_:).md)
- [xpc_dictionary_set_value(_:_:_:)](xpc/xpc_dictionary_set_value(_:_:_:).md)
- [xpc_dictionary_get_count(_:)](xpc/xpc_dictionary_get_count(_:).md)
- [xpc_dictionary_get_value(_:_:)](xpc/xpc_dictionary_get_value(_:_:).md)
- [xpc_dictionary_apply(_:_:)](xpc/xpc_dictionary_apply(_:_:).md)
- [xpc_dictionary_dup_fd(_:_:)](xpc/xpc_dictionary_dup_fd(_:_:).md)
- [xpc_dictionary_get_array(_:_:)](xpc/xpc_dictionary_get_array(_:_:).md)
- [xpc_dictionary_get_bool(_:_:)](xpc/xpc_dictionary_get_bool(_:_:).md)
- [xpc_dictionary_get_data(_:_:_:)](xpc/xpc_dictionary_get_data(_:_:_:).md)
- [xpc_dictionary_get_date(_:_:)](xpc/xpc_dictionary_get_date(_:_:).md)
- [xpc_dictionary_get_double(_:_:)](xpc/xpc_dictionary_get_double(_:_:).md)
