title: App crashes after Xcode upgrade to 4.5. Assigning retained object to unsafe_unretained variable
body: <p>In my class I have a <code>dispatch_queue_t</code> property declared like this:</p>
  
  <pre><code>@property (nonatomic, assign) dispatch_queue_t queue;
  </code></pre>
  
  <p>Then in my init method I do:</p>
  
  <pre><code>- (id)initWithServerUrls: (NSString*)serverUrls
  {
      if (self = [super init])
      {
          _queue = dispatch_queue_create("com.xxx.my_send_queue", DISPATCH_QUEUE_SERIAL);
      }
  
      return self;
  }
  </code></pre>
  
  <p>In Xcode 4.4.1 it worked and did not cause any problems (the app tested + in the appstore).
  Now after I upgraded to Xcode 4.5 the app crashes with <strong>EXC_BAD_ACCESS</strong> and Xcode gives me a warning on that line saying:</p>
  
  <p><strong>Assigning retained object to unsafe_unretained variable; object will be released after assignment</strong></p>
  
  <p>Apple updated the compiler in Xcode 4.5 from LLVM 4.0 to LLVM 4.1 but I have no clue why my code is crashing right now.</p>
  
  <p>I stepped through the code and the crash happens just after that line.
  Do you have any ideas what can be wrong and how can I fix it?</p>
  
  <p><strong>SOLUTION:</strong></p>
  
  <p>I managed to get it working with both SDKs. I just added:</p>
  
  <pre><code>#if OS_OBJECT_USE_OBJC
  @property (nonatomic, strong) dispatch_queue_t queue; // this is for Xcode 4.5 with LLVM 4.1 and iOS 6 SDK
  #else
  @property (nonatomic, assign) dispatch_queue_t queue; // this is for older Xcodes with older SDKs
  #endif
  </code></pre>
  
  <p>Hope someone finds it useful</p>