Returns the reference count of a Core Foundation object.


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



The CFType object to examine.

Return Value

A number representing the reference count of cf.


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

func CFGetAllocator(CFTypeRef!) -> CFAllocator!

Returns the allocator used to allocate a Core Foundation object.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software