<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/xpc_dictionary_set_value(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "c:@F@xpc_dictionary_set_value"
  },
  "title" : "xpc_dictionary_set_value(_:_:_:)"
}
-->

# xpc_dictionary_set_value(_:_:_:)

Sets the value for the specified key to the specified object.

```
func xpc_dictionary_set_value(_ xdict: xpc_object_t, _ key: UnsafePointer<CChar>, _ value: xpc_object_t?)
```

## Parameters

`xdict`

The dictionary object which is to be manipulated.

`key`

The key for which the value shall be set.

`value`

The object to insert. The object is retained by the dictionary. If there already exists a value for the specified key, the old value is released and overwritten by the new value. This parameter may be NULL, in which case the value corresponding to the specified key is deleted if present.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)