title: Use Block in Objective C to find out if a BOOL has been set?
body: <p>I'm new to Obj-c. I've got a class which sets a var boolean to YES if it's successful (Game Center login = successful), what it would be great to do, is somehow have a listener to that var that listens to when it is YES and then executes some code. Do I use a block for that? I'm also using the Sparrow framework. </p>
  
  <p>Here's my code in my GameCenter.m file</p>
  
  <pre><code>-(void) setup
  {
      gameCenterAuthenticationComplete = NO;
  
      if (!isGameCenterAPIAvailable()) {
          // Game Center is not available.
          NSLog(@"Game Center is not available.");
      } else {
          NSLog(@"Game Center is available.");
  
              __weak typeof(self) weakSelf = self; // removes retain cycle error
  
              GKLocalPlayer *localPlayer =  [GKLocalPlayer localPlayer]; // localPlayer is the public GKLocalPlayer
  
          __weak GKLocalPlayer *weakPlayer = localPlayer; // removes retain cycle error
  
              weakPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error)
              {
                  if (viewController != nil)
                  {
                      [weakSelf showAuthenticationDialogWhenReasonable:viewController];
                  }
                  else if (weakPlayer.isAuthenticated)
                  {
                      [weakSelf authenticatedPlayer:weakPlayer];
                  }
                  else
                  {
                      [weakSelf disableGameCenter];
                  }
              };
          }
  
      }
  
      -(void)showAuthenticationDialogWhenReasonable:(UIViewController *)controller
      {
          [[[[[UIApplication sharedApplication] delegate] window] rootViewController] presentViewController:controller animated:YES completion:nil];
      }
  
      -(void)authenticatedPlayer:(GKLocalPlayer *)player
      {
          NSLog(@"%@,%@,%@",player.playerID,player.displayName, player.alias);
  
          gameCenterAuthenticationComplete = YES;
  
      }
  
      -(void)disableGameCenter
      {
  
      }
  </code></pre>
  
  <p>But I need to know from a different object if that gameCenterAuthenticationComplete equals YES.</p>