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

# xpc_array_set_uuid(_:_:_:)

Inserts a UUID primitive value into an array.

```
func xpc_array_set_uuid(_ xarray: xpc_object_t, _ index: Int, _ uuid: UnsafePointer<UInt8>)
```

## Parameters

`xarray`

The array object which is to be manipulated.

`index`

The index at which to insert the value. This value must lie within the index space of the array (0 to N-1 inclusive, where N is the count of the array) or be [`XPC_ARRAY_APPEND`](/documentation/XPC/XPC_ARRAY_APPEND-swift.var). If the index is outside that range, the behavior is undefined.

`uuid`

The UUID primitive to insert. After calling this method, the XPC object corresponding to the primitive value inserted may be safely retrieved with [`xpc_array_get_value(_:_:)`](/documentation/XPC/xpc_array_get_value(_:_:)).

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