iOS UIAlertController代码stream控制

-(bool)textFieldShouldClear:(UITextField *)textField { UIAlertController * blert = [UIAlertController alertControllerWithTitle:@"your alert" message:@"are you sure you want to clear" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction * defautact = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action){ NSLog(@"tao on YES"); // click= YES; _baba =@"yes"; }]; UIAlertAction * defautact1 = [UIAlertAction actionWithTitle:@"cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action){ NSLog(@"Press on YES"); // click= NO; //field1.text=@""; _baba=@"no"; }]; [blert addAction:defautact]; [blert addAction: defautact1]; [self presentViewController:blert animated:YES completion:nil]; if([_baba isEqualToString:@"yes"]) { return true; } else { return false; } } 

当这个方法被首先调用时, if块被执行,然后UIAlertController正在执行,所以我得到一个不确定的结果,所以任何人都可以解决这个问题,并使其工作在一个崇敬的顺序。

任何人都可以告诉我为什么视图控制器没有最后触发,但不是第一次?