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

# xpc_dictionary_get_count(_:)

Returns the number of values in the dictionary.

```
func xpc_dictionary_get_count(_ xdict: xpc_object_t) -> Int
```

## Parameters

`xdict`

The dictionary object which is to be examined.

## Return Value

The number of values stored in the dictionary. Calling [`xpc_dictionary_set_value(_:_:_:)`](/documentation/XPC/xpc_dictionary_set_value(_:_:_:)) with a non-`NULL` value will increment the count. Calling [`xpc_dictionary_set_value(_:_:_:)`](/documentation/XPC/xpc_dictionary_set_value(_:_:_:)) with a `NULL` value will decrement the count.

## 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)