---
title: XPC objects
framework: xpc
role: collectionGroup
role_heading: API Collection
path: xpc/xpc-objects
---

# XPC objects

Encapsulate data in objects that represent primitive types, collections, and more.

## Topics

### Objects

- [xpc_object_t](xpc/xpc_object_t.md)
- [xpc_type_t](xpc/xpc_type_t.md)
- [OS_xpc_object](xpc/os_xpc_object.md)
- [OS_xpc_listener](xpc/os_xpc_listener-swift.class.md)

### Identity

- [xpc_get_type(_:)](xpc/xpc_get_type(_:).md)
- [xpc_type_get_name(_:)](xpc/xpc_type_get_name(_:).md)
- [xpc_hash(_:)](xpc/xpc_hash(_:).md)

### Comparison

- [xpc_equal(_:_:)](xpc/xpc_equal(_:_:).md)

### Copying

- [xpc_copy(_:)](xpc/xpc_copy(_:).md)
- [xpc_copy_description(_:)](xpc/xpc_copy_description(_:).md)

### Boolean objects

- [xpc_bool_create(_:)](xpc/xpc_bool_create(_:).md)
- [xpc_bool_get_value(_:)](xpc/xpc_bool_get_value(_:).md)
- [XPC_BOOL_TRUE](xpc/xpc_bool_true-swift.var.md)
- [XPC_BOOL_FALSE](xpc/xpc_bool_false-swift.var.md)

### Data objects

- [xpc_data_create(_:_:)](xpc/xpc_data_create(_:_:).md)
- [xpc_data_create_with_dispatch_data(_:)](xpc/xpc_data_create_with_dispatch_data(_:).md)
- [xpc_data_get_bytes(_:_:_:_:)](xpc/xpc_data_get_bytes(_:_:_:_:).md)
- [xpc_data_get_bytes_ptr(_:)](xpc/xpc_data_get_bytes_ptr(_:).md)
- [xpc_data_get_length(_:)](xpc/xpc_data_get_length(_:).md)

### Number objects

- [xpc_double_create(_:)](xpc/xpc_double_create(_:).md)
- [xpc_double_get_value(_:)](xpc/xpc_double_get_value(_:).md)
- [xpc_int64_create(_:)](xpc/xpc_int64_create(_:).md)
- [xpc_int64_get_value(_:)](xpc/xpc_int64_get_value(_:).md)
- [xpc_uint64_create(_:)](xpc/xpc_uint64_create(_:).md)
- [xpc_uint64_get_value(_:)](xpc/xpc_uint64_get_value(_:).md)

### Array objects

- [XPCArray](xpc/xpcarray.md)
- [xpc_array_create(_:_:)](xpc/xpc_array_create(_:_:).md)
- [xpc_array_create_empty()](xpc/xpc_array_create_empty().md)
- [xpc_array_create_connection(_:_:)](xpc/xpc_array_create_connection(_:_:).md)
- [xpc_array_set_value(_:_:_:)](xpc/xpc_array_set_value(_:_:_:).md)
- [xpc_array_get_value(_:_:)](xpc/xpc_array_get_value(_:_:).md)
- [xpc_array_append_value(_:_:)](xpc/xpc_array_append_value(_:_:).md)
- [xpc_array_get_count(_:)](xpc/xpc_array_get_count(_:).md)
- [xpc_array_apply(_:_:)](xpc/xpc_array_apply(_:_:).md)
- [xpc_array_dup_fd(_:_:)](xpc/xpc_array_dup_fd(_:_:).md)
- [xpc_array_get_array(_:_:)](xpc/xpc_array_get_array(_:_:).md)
- [xpc_array_get_bool(_:_:)](xpc/xpc_array_get_bool(_:_:).md)
- [xpc_array_get_data(_:_:_:)](xpc/xpc_array_get_data(_:_:_:).md)
- [xpc_array_get_date(_:_:)](xpc/xpc_array_get_date(_:_:).md)
- [xpc_array_get_dictionary(_:_:)](xpc/xpc_array_get_dictionary(_:_:).md)
- [xpc_array_get_double(_:_:)](xpc/xpc_array_get_double(_:_:).md)
- [xpc_array_get_int64(_:_:)](xpc/xpc_array_get_int64(_:_:).md)
- [xpc_array_get_string(_:_:)](xpc/xpc_array_get_string(_:_:).md)
- [xpc_array_get_uint64(_:_:)](xpc/xpc_array_get_uint64(_:_:).md)
- [xpc_array_get_uuid(_:_:)](xpc/xpc_array_get_uuid(_:_:).md)
- [xpc_array_set_bool(_:_:_:)](xpc/xpc_array_set_bool(_:_:_:).md)
- [xpc_array_set_connection(_:_:_:)](xpc/xpc_array_set_connection(_:_:_:).md)
- [xpc_array_set_data(_:_:_:_:)](xpc/xpc_array_set_data(_:_:_:_:).md)
- [xpc_array_set_date(_:_:_:)](xpc/xpc_array_set_date(_:_:_:).md)
- [xpc_array_set_double(_:_:_:)](xpc/xpc_array_set_double(_:_:_:).md)
- [xpc_array_set_fd(_:_:_:)](xpc/xpc_array_set_fd(_:_:_:).md)
- [xpc_array_set_int64(_:_:_:)](xpc/xpc_array_set_int64(_:_:_:).md)
- [xpc_array_set_string(_:_:_:)](xpc/xpc_array_set_string(_:_:_:).md)
- [xpc_array_set_uint64(_:_:_:)](xpc/xpc_array_set_uint64(_:_:_:).md)
- [xpc_array_set_uuid(_:_:_:)](xpc/xpc_array_set_uuid(_:_:_:).md)
- [xpc_array_applier_t](xpc/xpc_array_applier_t.md)
- [XPC_ARRAY_APPEND](xpc/xpc_array_append-swift.var.md)

### Dictionary objects

- [XPCDictionary](xpc/xpcdictionary.md)
- [xpc_dictionary_create(_:_:_:)](xpc/xpc_dictionary_create(_:_:_:).md)
- [xpc_dictionary_create_empty()](xpc/xpc_dictionary_create_empty().md)
- [xpc_dictionary_create_connection(_:_:)](xpc/xpc_dictionary_create_connection(_:_:).md)
- [xpc_dictionary_create_reply(_:)](xpc/xpc_dictionary_create_reply(_:).md)
- [xpc_dictionary_set_value(_:_:_:)](xpc/xpc_dictionary_set_value(_:_:_:).md)
- [xpc_dictionary_get_count(_:)](xpc/xpc_dictionary_get_count(_:).md)
- [xpc_dictionary_get_value(_:_:)](xpc/xpc_dictionary_get_value(_:_:).md)
- [xpc_dictionary_apply(_:_:)](xpc/xpc_dictionary_apply(_:_:).md)
- [xpc_dictionary_dup_fd(_:_:)](xpc/xpc_dictionary_dup_fd(_:_:).md)
- [xpc_dictionary_get_array(_:_:)](xpc/xpc_dictionary_get_array(_:_:).md)
- [xpc_dictionary_get_bool(_:_:)](xpc/xpc_dictionary_get_bool(_:_:).md)
- [xpc_dictionary_get_data(_:_:_:)](xpc/xpc_dictionary_get_data(_:_:_:).md)
- [xpc_dictionary_get_date(_:_:)](xpc/xpc_dictionary_get_date(_:_:).md)
- [xpc_dictionary_get_dictionary(_:_:)](xpc/xpc_dictionary_get_dictionary(_:_:).md)
- [xpc_dictionary_get_double(_:_:)](xpc/xpc_dictionary_get_double(_:_:).md)
- [xpc_dictionary_get_int64(_:_:)](xpc/xpc_dictionary_get_int64(_:_:).md)
- [xpc_dictionary_get_remote_connection(_:)](xpc/xpc_dictionary_get_remote_connection(_:).md)
- [xpc_dictionary_get_string(_:_:)](xpc/xpc_dictionary_get_string(_:_:).md)
- [xpc_dictionary_get_uint64(_:_:)](xpc/xpc_dictionary_get_uint64(_:_:).md)
- [xpc_dictionary_get_uuid(_:_:)](xpc/xpc_dictionary_get_uuid(_:_:).md)
- [xpc_dictionary_set_bool(_:_:_:)](xpc/xpc_dictionary_set_bool(_:_:_:).md)
- [xpc_dictionary_set_connection(_:_:_:)](xpc/xpc_dictionary_set_connection(_:_:_:).md)
- [xpc_dictionary_set_data(_:_:_:_:)](xpc/xpc_dictionary_set_data(_:_:_:_:).md)
- [xpc_dictionary_set_date(_:_:_:)](xpc/xpc_dictionary_set_date(_:_:_:).md)
- [xpc_dictionary_set_double(_:_:_:)](xpc/xpc_dictionary_set_double(_:_:_:).md)
- [xpc_dictionary_set_fd(_:_:_:)](xpc/xpc_dictionary_set_fd(_:_:_:).md)
- [xpc_dictionary_set_int64(_:_:_:)](xpc/xpc_dictionary_set_int64(_:_:_:).md)
- [xpc_dictionary_set_string(_:_:_:)](xpc/xpc_dictionary_set_string(_:_:_:).md)
- [xpc_dictionary_set_uint64(_:_:_:)](xpc/xpc_dictionary_set_uint64(_:_:_:).md)
- [xpc_dictionary_set_uuid(_:_:_:)](xpc/xpc_dictionary_set_uuid(_:_:_:).md)
- [xpc_dictionary_applier_t](xpc/xpc_dictionary_applier_t.md)
- [xpc_dictionary_copy_mach_send(_:_:)](xpc/xpc_dictionary_copy_mach_send(_:_:).md)
- [xpc_dictionary_set_mach_send(_:_:_:)](xpc/xpc_dictionary_set_mach_send(_:_:_:).md)

### String objects

- [xpc_string_create(_:)](xpc/xpc_string_create(_:).md)
- [xpc_string_create_with_format_and_arguments(_:_:)](xpc/xpc_string_create_with_format_and_arguments(_:_:).md)
- [xpc_string_get_length(_:)](xpc/xpc_string_get_length(_:).md)
- [xpc_string_get_string_ptr(_:)](xpc/xpc_string_get_string_ptr(_:).md)

### File Descriptor objects

- [xpc_fd_create(_:)](xpc/xpc_fd_create(_:).md)
- [xpc_fd_dup(_:)](xpc/xpc_fd_dup(_:).md)

### Date objects

- [xpc_date_create(_:)](xpc/xpc_date_create(_:).md)
- [xpc_date_create_from_current()](xpc/xpc_date_create_from_current().md)
- [xpc_date_get_value(_:)](xpc/xpc_date_get_value(_:).md)

### UUID objects

- [xpc_uuid_create(_:)](xpc/xpc_uuid_create(_:).md)
- [xpc_uuid_get_bytes(_:)](xpc/xpc_uuid_get_bytes(_:).md)

### Shared memory objects

- [xpc_shmem_create(_:_:)](xpc/xpc_shmem_create(_:_:).md)
- [xpc_shmem_map(_:_:)](xpc/xpc_shmem_map(_:_:).md)

### Null objects

- [xpc_null_create()](xpc/xpc_null_create().md)

### Object life cycle

- [xpc_retain(_:)](xpc/xpc_retain(_:).md)
- [xpc_release(_:)](xpc/xpc_release(_:).md)

### Types of objects

- [XPC_TYPE_ACTIVITY](xpc/xpc_type_activity-swift.var.md)
- [XPC_TYPE_ARRAY](xpc/xpc_type_array-swift.var.md)
- [XPC_TYPE_BOOL](xpc/xpc_type_bool-swift.var.md)
- [XPC_TYPE_CONNECTION](xpc/xpc_type_connection-swift.var.md)
- [XPC_TYPE_DATA](xpc/xpc_type_data-swift.var.md)
- [XPC_TYPE_DATE](xpc/xpc_type_date-swift.var.md)
- [XPC_TYPE_DICTIONARY](xpc/xpc_type_dictionary-swift.var.md)
- [XPC_TYPE_DOUBLE](xpc/xpc_type_double-swift.var.md)
- [XPC_TYPE_ENDPOINT](xpc/xpc_type_endpoint-swift.var.md)
- [XPC_TYPE_FD](xpc/xpc_type_fd-swift.var.md)
- [XPC_TYPE_INT64](xpc/xpc_type_int64-swift.var.md)
- [XPC_TYPE_NULL](xpc/xpc_type_null-swift.var.md)
- [XPC_TYPE_SHMEM](xpc/xpc_type_shmem-swift.var.md)
- [XPC_TYPE_STRING](xpc/xpc_type_string-swift.var.md)
- [XPC_TYPE_UINT64](xpc/xpc_type_uint64-swift.var.md)
- [XPC_TYPE_UUID](xpc/xpc_type_uuid-swift.var.md)

### Errors

- [XPCRichError](xpc/xpcricherror.md)
- [XPC_TYPE_RICH_ERROR](xpc/xpc_type_rich_error-swift.var.md)
- [XPC_TYPE_ERROR](xpc/xpc_type_error-swift.var.md)
- [XPC_ERROR_KEY_DESCRIPTION](xpc/xpc_error_key_description-swift.var.md)
- [XPC_ERROR_PEER_CODE_SIGNING_REQUIREMENT](xpc/xpc_error_peer_code_signing_requirement-swift.var.md)

## See Also

### Additional Types

- [Utilities](xpc/utilities.md)
- [XPC connections](xpc/xpc-connections.md)
