Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Introspection

Core Foundation allows a variety of type introspection, primarily for debugging purposes. The most fundamental is the CFTypeID, which uniquely identifies the opaque type of the object, similar to Class in Objective-C. You can determine the type of a Core Foundation instance by calling CFGetTypeID. The returned value is opaque and subject to change between versions of iOS. You can compare the CFTypeID of two instances, but most often you compare the result of CFGetTypeID to the value from a function like CFArrayGetTypeID. All opaque types have a related GetTypeID function.

As in Cocoa, Core Foundation instances have a description for debugging purposes, returned by CFCopyDescription. This returns a CFString that you are responsible for releasing. CFCopyTypeIDDescription provides a similar string that describes a CFTypeID. You should not rely on the format or content of these because they’re subject to change.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial