---
title: "CFGetRetainCount(_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfgetretaincount(_:)"
---

# CFGetRetainCount(_:)

Returns the reference count of a Core Foundation object.

## Declaration

```swift
func CFGetRetainCount(_ cf: CFTypeRef!) -> CFIndex
```

## Parameters

- `cf`: The CFType object to examine.

## Return Value

Return Value A number representing the reference count of cf.

## Discussion

Discussion You increment the reference count using the CFRetain function, and decrement the reference count using the CFRelease function. This function may be useful for debugging memory leaks. You normally do not use this function, otherwise.

## See Also

### Memory Management

- [CFGetAllocator(_:)](corefoundation/cfgetallocator(_:).md)
