<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: 4.0.0 - 17.4.0",
    "macOS: 10.7.0 - 14.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "XPC",
  "identifier" : "/documentation/XPC/xpc_retain(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "XPC"
    ],
    "preciseIdentifier" : "s:3XPC10xpc_retainySo03OS_B7_object_pSoAC_pF"
  },
  "title" : "xpc_retain(_:)"
}
-->

# xpc_retain(_:)

```
func xpc_retain(_ object: xpc_object_t) -> xpc_object_t
```

---

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)