title: Retrieving the retain count for a CGImageRef object?
body: <p>While you can release a reference to a CGImageRef object using "CGImageRelease", which, according to the SDK this "decrements the retain count of a bitmap image", is there a way to inspect the current retain count for a CGImageRef instance?  [cgImageRef retainCount] isn't valid since CGImageRef isn't a valid receiver of the retainCount message.</p>
  
  <p>In other words, during dealloc within a class that renders an EAGLContext, I want to make sure any outstanding references to CGImageRef objects are released but I obviously don't want to call CGImageRelease(someCGImageRef) if its retain count is already 0.  I've found in practice that just checking to see if the image ref is nil isn't consistent with current retain count values.</p>
  
  <p>Is it a best practice to simply set the CGImageRef instance to nil after you're done with it and you've already released it so that a check for (someCGImageRef == nil) lets you know if there is an outstanding reference to it?</p>
  
  <p>Thanks</p>