Core Foundation Object Model#

Frameworks which use this model#

Official Apple#

Base class#

There are two base classes, CFType and the deprecated HIObject(Header with API docs).

Memory management#

Core Foundation types are not managed by Objective-C ARC, but are managed by Swift ARC. In Objective-C, you must use the CFRetain and CFRelease methods to retain and release the objects.

Subclassing#

CoreFoundation does not provide a public subclassing API. Older versions had an example of creating a subclass of CFType called EXRange. It looks like _CFRuntimeRegisterClass will create a subclass of CFType.

HIObjectRegisterSubclass will create a subclass of any class derived from HIObject.

Runtime#

The runtime functions are private, and are in CFRuntime.h.