dismissViewControllerAnimated does not work within a block
问题 I try to close a UIViewController after an UIAlertController has been shown. This is my code: UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Accept" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [self dismissViewControllerAnimated:YES completion:nil]; }]; [alertController addAction:okAction]; [self