title: Not expected strange behaviour of ARC during deallocating instances
body: <p>I'm refreshing my knowledge in Objective-C world and now I'm testing some ARC with <code>__weak</code> local variables.</p>
  
  <p>I have very simple code with such files <code>GAObject.h</code></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  @interface GAObject : NSObject
  + (instancetype)create;
  @end
  </code></pre>
  
  <p>Implementation of this interface <code>GAObject.h</code></p>
  
  <pre><code>#import "GAObject.h"
  @implementation GAObject
  + (instancetype)create {
      return [[GAObject alloc] init];
  }
  - (void)dealloc {
      NSLog(@"GAObject is being deallocated");
  }
  @end
  </code></pre>
  
  <p>So there is simple factory method <code>create</code> and I override <code>dealloc</code> method to watch if objects was deallocated when I expecting this. Now the funny part <code>main.m</code>:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "AppDelegate.h"
  #import "Learning/GAObject.h"
  
  int main(int argc, char * argv[]) {
      @autoreleasepool {
          NSLog(@"1");
          NSObject *o1 = [[GAObject alloc] init];
          NSObject * __weak weakObject = o1; // Line 1
          o1 = nil; // o1 should be deallocated because there is no strong references pointing to o1.
          NSLog(@"2");
          NSObject *o2 = [GAObject create]; // Line 2
          o2 = nil; // o2 should be deallocated here too but it is not deallocated. Why?
          NSLog(@"3");
  
          return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
      }
  }
  </code></pre>
  
  <p>In the output I see this:</p>
  
  <pre><code>1
  GAObject is being deallocated
  2
  3
  </code></pre>
  
  <p>But My expecting results should be:</p>
  
  <pre><code>1
  GAObject is being deallocated
  2
  GAObject is being deallocated
  3
  </code></pre>
  
  <p>If I create <code>o2</code> using factory method then I have this behaviour. If I create <code>o2</code> like this: <code>[[GAObject alloc] init]</code> then I get expected output. Also I noticed that when I remove line with <code>weakObject</code> I also get expected results. Can somebody explain it?</p>