---
title: CFTypeRef
framework: corefoundation
role: symbol
role_heading: Type Alias
path: corefoundation/cftyperef
---

# CFTypeRef

An untyped “generic” reference to any Core Foundation object.

## Declaration

```swift
typealias CFTypeRef = AnyObject
```

## Discussion

Discussion All other Core Foundation opaque types derive from CFTypeRef. The functions, callbacks, data types, and constants defined for CFType can be used by any derived opaque type. Hence, CFTypeRef functions are referred to as “polymorphic functions.” You use CFTypeRef functions to retain and release objects, to compare and inspect objects, get descriptions of objects and opaque types, and to get object allocators.

## Topics

### Memory Management

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

### Determining Equality

- [CFEqual(_:_:)](corefoundation/cfequal(_:_:).md)

### Hashing

- [CFHash(_:)](corefoundation/cfhash(_:).md)

### Miscellaneous Functions

- [CFCopyDescription(_:)](corefoundation/cfcopydescription(_:).md)
- [CFCopyTypeIDDescription(_:)](corefoundation/cfcopytypeiddescription(_:).md)
- [CFGetTypeID(_:)](corefoundation/cfgettypeid(_:).md)
- [CFShow(_:)](corefoundation/cfshow(_:).md)

### Data Types

- [CFHashCode](corefoundation/cfhashcode.md)
- [CFTypeID](corefoundation/cftypeid.md)

## See Also

### Related Documentation

- [Memory Management Programming Guide for Core Foundation](apple-archive/documentation/CoreFoundation/Conceptual/CFMemoryMgmt.md)
- [Core Foundation Design Concepts](apple-archive/documentation/CoreFoundation/Conceptual/CFDesignConcepts.md)

### Data Types

- [CFAllocatorTypeID](corefoundation/cfallocatortypeid.md)
- [CFCalendarIdentifier](corefoundation/cfcalendaridentifier.md)
- [CFDateFormatterKey](corefoundation/cfdateformatterkey.md)
- [CFErrorDomain](corefoundation/cferrordomain.md)
- [CFLocaleIdentifier](corefoundation/cflocaleidentifier.md)
- [CFLocaleKey](corefoundation/cflocalekey.md)
- [CFNotificationName](corefoundation/cfnotificationname.md)
- [CFNumberFormatterKey](corefoundation/cfnumberformatterkey.md)
- [CFRunLoopMode](corefoundation/cfrunloopmode.md)
- [CFStreamPropertyKey](corefoundation/cfstreampropertykey.md)
