Object References

You refer to opaque objects through references. In every header file for an opaque type, you will notice a line or two similar to the following:

typedef const struct __CFArray * CFArrayRef;
typedef struct __CFArray * CFMutableArrayRef;

Declarations such as these are pointer references to immutable and mutable versions of the (private) structure defining the opaque type. The parameters and return values of many Core Foundation functions take the type of these object references and never a typedef of the private structure. For example:

CFStringRef  CFStringCreateByCombiningStrings(CFAllocatorRef alloc, CFArrayRef array, CFStringRef separatorString);

See Varieties of Objects for more on immutable, mutable, and other variants of opaque-type objects.


© 1999 Apple Computer, Inc. – (Last Updated 07 September 99)