---
title: "CMRemoveAllAttachments(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmremoveallattachments(_:)"
---

# CMRemoveAllAttachments(_:)

Removes all attachments from an attachment bearer object.

## Declaration

```swift
func CMRemoveAllAttachments(_ target: CMAttachmentBearer)
```

## Parameters

- `target`: The CMAttachmentBearer whose attachment you want to remove.

## Discussion

Discussion While CMRemoveAttachment removes a specific attachment identified by a key, CMRemoveAllAttachments removes all attachments of a CMAttachmentBearer and decrements their retain counts.  Given a CVBuffer, CMRemoveAllAttachments is equivalent to CVBufferRemoveAllAttachments.

## See Also

### Processing Attachments

- [CMGetAttachment(_:key:attachmentModeOut:)](coremedia/cmgetattachment(_:key:attachmentmodeout:).md)
- [CMCopyDictionaryOfAttachments(allocator:target:attachmentMode:)](coremedia/cmcopydictionaryofattachments(allocator:target:attachmentmode:).md)
- [CMSetAttachment(_:key:value:attachmentMode:)](coremedia/cmsetattachment(_:key:value:attachmentmode:).md)
- [CMSetAttachments(_:attachments:attachmentMode:)](coremedia/cmsetattachments(_:attachments:attachmentmode:).md)
- [CMRemoveAttachment(_:key:)](coremedia/cmremoveattachment(_:key:).md)
- [CMPropagateAttachments(_:destination:)](coremedia/cmpropagateattachments(_:destination:).md)
