title: Garbage collection of Core Foundation objects
body: <p>Running the static analyzer on this piece of code:</p>
  
  <pre><code>- (id) readForeignPref
  {
   CFPropertyListRef matchStyle = CFPreferencesCopyAppValue(CFSTR("PBXFindMatchStyle"), CFSTR("com.apple.Xcode"));
   return [(id)matchStyle autorelease];
  }
  </code></pre>
  
  <p>yields the following warning:</p>
  
  <blockquote>
    <p>Call to function 'CFPreferencesCopyAppValue' returns a Core Foundation object with a +1 retain count (owning reference).  Core Foundation objects are not automatically garbage collected.</p>
  </blockquote>
  
  <p>Is this a warning I should fix with somethin ugly like that:</p>
  
  <pre><code>- (id) readForeignPref
  {
   CFPropertyListRef matchStyle = CFPreferencesCopyAppValue(CFSTR("PBXFindMatchStyle"), CFSTR("com.apple.Xcode"));
   id nsMatchStyle = [(id)matchStyle copy];
   if (matchStyle) {
    CFRelease(matchStyle);
   }
   return [nsMatchStyle autorelease];
  }
  </code></pre>
  
  <p>or is this just a false positive, given that the copied object is toll-free bridged?</p>