CFType

Overview

All other Core Foundation opaque types derive from CFType. The functions, callbacks, data types, and constants defined for CFType can be used by any derived opaque type. Hence, CFType functions are referred to as “polymorphic functions.” You use CFType 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

func CFGetAllocator(CFTypeRef!)

Returns the allocator used to allocate a Core Foundation object.

func CFGetRetainCount(CFTypeRef!)

Returns the reference count of a Core Foundation object.

Determining Equality

func CFEqual(CFTypeRef!, CFTypeRef!)

Determines whether two Core Foundation objects are considered equal.

Hashing

func CFHash(CFTypeRef!)

Returns a code that can be used to identify an object in a hashing structure.

Miscellaneous Functions

func CFCopyDescription(CFTypeRef!)

Returns a textual description of a Core Foundation object.

func CFCopyTypeIDDescription(CFTypeID)

Returns a textual description of a Core Foundation type, as identified by its type ID, which can be used when debugging.

func CFGetTypeID(CFTypeRef!)

Returns the unique identifier of an opaque type to which a Core Foundation object belongs.

func CFShow(CFTypeRef!)

Prints a description of a Core Foundation object to stderr.

Data Types

typealias CFHashCode

A type for hash codes returned by the CFHash function.

typealias CFTypeID

A type for unique, constant integer values that identify particular Core Foundation opaque types.

typealias CFTypeRef

An untyped "generic" reference to any Core Foundation object.

See Also

Opaque Types

CFFileDescriptor

The CFFileDescriptor provides an opaque type to monitor file descriptors for read and write activity via CFRunLoop.

CFStringTokenizer

CFStringTokenizer allows you to tokenize strings into words, sentences or paragraphs in a language-neutral way. It supports languages such as Japanese and Chinese that do not delimit words by spaces, as well as de-compounding German compounds. You can obtain Latin transcription for tokens. It also provides language identification API.