把下面这句话放在block内部”不然会死循环,导致警告控制器不能销毁"
UITextField *textField = alertA.textFields.firstObject;
UIAlertAction
*ok = [
UIAlertAction
actionWithTitle
:
@"
确定
"
style
:
UIAlertActionStyleDefault
handler
:^(
UIAlertAction
*
_Nonnull
action) {
hero. name = textField. text ;
[ self . tableView reloadData ];
// [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [alertA dismissViewControllerAnimated:NO completion:nil];
hero. name = textField. text ;
[ self . tableView reloadData ];
// [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
// [alertA dismissViewControllerAnimated:NO completion:nil];
}];