title: Retained Core Foundation Property
body: <p>(Xcode 4.2, iOS 5, <strong>ARC</strong>)</p>
  
  <p>I have some properties of Core Foundation (/Graphics) objects that should take ownership of their objects. Now in these <a href="https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProperties.html#//apple_ref/doc/uid/TP30001163-CH17-SW2" rel="noreferrer">Apple docs</a> I found this:</p>
  
  <blockquote>
    <p>In OS X v10.6 and later, you can use the __attribute__ keyword to specify that a Core Foundation property should be treated like an
    Objective-C object for memory management:
    <code>@property(retain) __attribute__((NSObject)) CFDictionaryRef myDictionary;</code></p>
  </blockquote>
  
  <p>Unfortunately I couldn't find any elaboration on this. I'm using this:</p>
  
  <p><code>@property (nonatomic, strong) __attribute__((NSObject)) CGImageRef loupeImage;</code></p>
  
  <p>And it seems to work the way I'd expect. It retains the object on setting the property and releases it when I set the property to nil.</p>
  
  <p>Now my question is, do I still need to explicitly set those properties to nil in my dealloc?</p>