title: "Capturing 'self' strongly in this block is likely to lead to a retain cycle" using Reachability
body: <p>I'm trying to edit a variable inside the Reachability block using Objective-C, this is the code:</p>
  
  <pre><code>- (void)testInternetConnection
  {
      internetReachableFoo = [Reachability reachabilityWithHostname:@"www.google.com"];
      // Internet is reachable
      internetReachableFoo.reachableBlock = ^(Reachability*reach)
      {
          // Update the UI on the main thread
          dispatch_async(dispatch_get_main_queue(), ^{
              NSLog(@"Connessione ad Internet disponibile");
              checkConnection = YES;
              if(!lastConnectionState)
              {
                  lastConnectionState = YES;
                  if(doItemsDownload)
                      [self displayChoice];
              }
          });
      };
  
      // Internet is not reachable
      internetReachableFoo.unreachableBlock = ^(Reachability*reach)
      {
          // Update the UI on the main thread
          dispatch_async(dispatch_get_main_queue(), ^{
              NSLog(@"Connessione ad Internet non disponibile");
              checkConnection = NO;
              lastConnectionState = NO;
          });
      };
  
      [internetReachableFoo startNotifier];
  }
  </code></pre>
  
  <p>Where <code>checkConnection;</code> &amp; <code>lastConnectionState;</code> are 2 bool declared on my @interface;
  The problem is that accessing these variables and calling <code>[self displayChoice];</code> inside this block gives me the warning: <code>Capturing 'self' strongly in this block is likely to lead to a retain cycle</code></p>
  
  <p>How can I possibly avoid this error?
  I tried declaring a <code>WeakSelf</code> and declaring <code>self</code> but I don't know how to do it for the bool variables</p>