title: Objective-C ARC block __strong __weak
body: <p>With ARC</p>
  
  <p>test1:</p>
  
  <pre><code>@interface test01ViewController ()
  
  @property (strong) void(^myBlock)(id obj, NSUInteger idx, BOOL stop);
  
  @end
  
  @implementation test01ViewController
  
  - (void)viewDidLoad {
      [super viewDidLoad];
      // Do any additional setup after loading the view from its nib.
      self.navigationItem.title = @"test01";
  
      [self setMyBlock:^(id obj, NSUInteger idx, BOOL stop) {
          [self doSomethingWithObj:obj];
      }];
  }
  </code></pre>
  
  <p>object (<code>self</code>) has an explicit strong reference to the block. And the block has an implicit <code>strong</code> reference to <code>self</code>. That's a cycle, and now neither object will be deallocated properly. </p>
  
  <p>so test1 <code>dealloc</code> not calling.</p>
  
  <p>test2:</p>
  
  <pre><code>@interface test03ViewController ()
  
  @property (strong) void(^myBlock)(id obj, NSUInteger idx, BOOL stop);
  
  @end
  
  @implementation test03ViewController
  
  - (void)viewDidLoad {
      [super viewDidLoad];
      // Do any additional setup after loading the view from its nib.
  
      self.navigationItem.title = @"test03";
  
      __weak test03ViewController *weakSelf = self;
      [self setMyBlock:^(id obj, NSUInteger idx, BOOL stop) {
          __strong test03ViewController *strongSelf = weakSelf;
          [strongSelf doSomethingWithObj:obj];
      }];
  } 
  </code></pre>
  
  <p>__weakSelf - > __strongSelf, I think it not difference with <code>test1</code> , but test2 can calling <code>dealloc</code>.</p>
  
  <p>Why?</p>