<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMCopyDictionaryOfAttachments(allocator:target:attachmentMode:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMCopyDictionaryOfAttachments"
  },
  "title" : "CMCopyDictionaryOfAttachments(allocator:target:attachmentMode:)"
}
-->

# CMCopyDictionaryOfAttachments(allocator:target:attachmentMode:)

Returns a dictionary of all attachments for an attachment bearer object.

```
func CMCopyDictionaryOfAttachments(allocator: CFAllocator?, target: CMAttachmentBearer, attachmentMode: CMAttachmentMode) -> sending CFDictionary?
```

## Parameters

`allocator`

Allocator for the new dictionary; pass <doc://com.apple.documentation/documentation/CoreFoundation/kCFAllocatorDefault> or `NULL` to use the default allocator.

`target`

Specifies the [`CMAttachmentBearer`](/documentation/CoreMedia/CMAttachmentBearer) whose attachments you want to obtain.

`attachmentMode`

The mode of the attachments you want to obtain. See [`CMAttachmentMode`](/documentation/CoreMedia/CMAttachmentMode) for possible values.

## Return Value

A Core Foundation dictionary with all attachments identified by their keys. If no attachment is present, the dictionary is empty. Returns `NULL` for an invalid attachment mode.

## Discussion

`CMCopyDictionaryOfAttachments` is a convenience call that returns all attachments with their corresponding keys in a new <doc://com.apple.documentation/documentation/CoreFoundation/CFDictionary>. Given a `CVBufferRef`, `CMCopyDictionaryOfAttachments` is similar to `CVBufferGetAttachments`, except that the `CFDictionary` that `CMCopyDictionaryOfAttachments` returns isn’t updated for later changes to the attachments.

---

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)