---
title: CFMutableArray
framework: corefoundation
role: symbol
role_heading: Class
path: corefoundation/cfmutablearray
---

# CFMutableArray

## Declaration

```swift
class CFMutableArray
```

## Overview

Overview CFMutableArray manages dynamic arrays. The basic interface for managing arrays is provided by CFArray. CFMutableArray adds functions to modify the contents of an array. You create a mutable array object using either the CFArrayCreateMutable(_:_:_:) or CFArrayCreateMutableCopy(_:_:_:) function. CFMutableArray provides several functions for changing the contents of an array, for example the CFArrayAppendValue(_:_:) and CFArrayInsertValueAtIndex(_:_:_:) functions add values to an array and CFArrayRemoveValueAtIndex(_:_:) removes values from an array. You can also reorder the contents of an array using CFArrayExchangeValuesAtIndices(_:_:_:) and CFArraySortValues(_:_:_:_:). CFMutableArray is “toll-free bridged” with its Cocoa Foundation counterpart, NSMutableArray. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSMutableArray * parameter, you can pass in a CFMutableArrayRef, and in a function where you see a CFMutableArrayRef parameter, you can pass in an NSMutableArray instance. This fact also applies to concrete subclasses of NSMutableArray. See Toll-Free Bridged Types for more information on toll-free bridging.

## Topics

### CFMutableArray Miscellaneous Functions

- [CFArrayAppendArray(_:_:_:)](corefoundation/cfarrayappendarray(_:_:_:).md)
- [CFArrayAppendValue(_:_:)](corefoundation/cfarrayappendvalue(_:_:).md)
- [CFArrayCreateMutable(_:_:_:)](corefoundation/cfarraycreatemutable(_:_:_:).md)
- [CFArrayCreateMutableCopy(_:_:_:)](corefoundation/cfarraycreatemutablecopy(_:_:_:).md)
- [CFArrayExchangeValuesAtIndices(_:_:_:)](corefoundation/cfarrayexchangevaluesatindices(_:_:_:).md)
- [CFArrayInsertValueAtIndex(_:_:_:)](corefoundation/cfarrayinsertvalueatindex(_:_:_:).md)
- [CFArrayRemoveAllValues(_:)](corefoundation/cfarrayremoveallvalues(_:).md)
- [CFArrayRemoveValueAtIndex(_:_:)](corefoundation/cfarrayremovevalueatindex(_:_:).md)
- [CFArrayReplaceValues(_:_:_:_:)](corefoundation/cfarrayreplacevalues(_:_:_:_:).md)
- [CFArraySetValueAtIndex(_:_:_:)](corefoundation/cfarraysetvalueatindex(_:_:_:).md)
- [CFArraySortValues(_:_:_:_:)](corefoundation/cfarraysortvalues(_:_:_:_:).md)

## Relationships

### Inherits From

- [CFArray](corefoundation/cfarray.md)

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Related Documentation

- [Collections Programming Topics for Core Foundation](apple-archive/documentation/CoreFoundation/Conceptual/CFCollections.md)

### Opaque Types

- [CFAllocator](corefoundation/cfallocator.md)
- [CFArray](corefoundation/cfarray.md)
- [CFAttributedString](corefoundation/cfattributedstring.md)
- [CFBag](corefoundation/cfbag.md)
- [CFBinaryHeap](corefoundation/cfbinaryheap.md)
- [CFBitVector](corefoundation/cfbitvector.md)
- [CFBoolean](corefoundation/cfboolean.md)
- [CFBundle](corefoundation/cfbundle.md)
- [CFCalendar](corefoundation/cfcalendar.md)
- [CFCharacterSet](corefoundation/cfcharacterset.md)
- [CFData](corefoundation/cfdata.md)
- [CFDate](corefoundation/cfdate.md)
- [CFDateFormatter](corefoundation/cfdateformatter.md)
- [CFDictionary](corefoundation/cfdictionary.md)
- [CFError](corefoundation/cferror.md)
