<!--
{
  "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_get_string(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "c:@F@xpc_dictionary_get_string"
  },
  "title" : "xpc_dictionary_get_string(_:_:)"
}
-->

# xpc_dictionary_get_string(_:_:)

Gets a C-string value from a dictionary directly.

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

## Parameters

`xdict`

The dictionary object which is to be examined.

`key`

The key whose value is to be obtained.

## Return Value

The underlying C string for the specified key. NULL if the value for the specified key is not a C string value or if there is no value for the specified key.

## Discussion

---

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)