title: Why use typeof() instead of the object type when avoiding block retain cycles?
body: <p>I have seen this code snippet frequently when other ObjC developer are breaking a retain cycle.</p>
  
  <pre><code>__weak typeof(self) weakSelf = self;
  [someObject doThingWithCompletion:^{
      typeof(weakSelf) strongSelf = weakSelf;
      [strongSelf awesomeThingOne];
      [strongSelf moreAwesome];
  }];
  </code></pre>
  
  <p><strong>Why the use of the <code>typeof()</code> macro? Is this unique to blocks?</strong></p>
  
  <p>My initial thought is that <code>self</code>'s type might not be known (that seems mostly impossible, but let's pretend...). If the type is unknown, then why not declare <code>weakSelf</code> with an <code>id</code>: <code>__weak id weakSelf = self;</code>?</p>
  
  <p>My second thought is that it's defensive against subclassing, but that seems unlikely to cause an issue. Assume <code>ObjTwo</code> subclasses <code>AwesomeObj</code> and overrides the <code>awesomeThingOne</code> method. The fake code above should work just fine if <code>self</code> is an instance of <code>ObjTwo</code> or <code>AwesomeObj</code>.</p>