title: How to identify a Core Foundation object if Apple recommend to not hardcode the type IDs?
body: <p>My application is interfaced with the CoreFoundation library. Some functions of another library returns a core foundation object and I need to identify the kind of object in order to process the data.
  Now, looking on the CFType library reference, Apple clearly states the following:
  "Because the value for a type ID can change from release to release, your code should not rely on stored or hard-coded type IDs nor should it hard-code any observed properties of a type ID (such as, for example, it being a small integer)."</p>
  
  <p>Based on that, I have to avoid any enum (<code>CFArray = 18, CFBoolean = 21</code> and so on).
  The only thing that should work and be immune to changes of new releases is something like:</p>
  
  <p><code>int ID = CFGetTypeID(obj);</code>
  <code>if ID = CFBooleanGetTypeID()</code> then...
  <code>if ID = CFStringGetTypeID()</code> then...
  <code>if ID = CFDataGetTypeID()</code> then..
  and so on...</p>
  
  <p>This is really something horrible. Lots of calls only to identify an object.</p>
  
  <p>Apple also recommends to not create dependencies on the content or format of the information returned from CFCopyTypeIDDescription and therefore I have to exclude also this option.</p>
  
  <p>Anyone know how I can easily identify a returned core foundation type and why Apple always try to break existing code with the new releases ?</p>