title: Boolean does not get set on the right moment
body: <p>I have a <code>BOOL loginStatus</code> that I am going to use in a login flow. </p>
  
  <hr>
  
  <h2>Code</h2>
  
  <pre><code>- (IBAction)login:(id)sender {
      if ([self credentialsValidated]) {
              [self performSegueWithIdentifier:@"showLogin" sender:self];
       }else {
         NSLog(@"not valid");
       }
  }
  
  - (BOOL)credentialsValidated {
       [[API sharedInstance] loginCommand:[NSMutableDictionary dictionaryWithObjectsAndKeys:_txtLogin.text,@"email",_txtPass.text,@"pwd", nil] onCompletion:^(NSDictionary *json){
       //completion
           if(![json objectForKey:@"error"]){
               if([[json valueForKeyPath:@"data.status"]intValue] == 200){
                  //Create user object
                   NSLog(@"tot hier");
                  loginstatus =  YES;
               }else{
                   //show validation
                   NSString *message = [NSString stringWithFormat:@"%@",[json valueForKeyPath:@"data.text"]];
                   [[[UIAlertView alloc]initWithTitle:@"Fout" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]show];
                   _txtLogin.text = @"";
                   _txtPass.text = @"";
                   loginstatus = NO;
               }
           }else {
               NSLog(@"Cannot connect to the server");
           }
       }];
       if(loginstatus){
           NSLog(@"true");
      }else{
          NSLog(@"false");
      }
       return loginstatus;
  }
  </code></pre>
  
  <hr>
  
  <p>The problem I have is that my <code>BOOL</code> is not set immediately. I always need to press two times the login button before my boolean is set correctly. </p>
  
  <p>Any ideas?</p>