UIAlertController使用的一个坑

来源:互联网 发布:mac能玩守望先锋吗 编辑:程序博客网 时间:2024/05/01 12:02
把下面这句话放在block内部”不然会死循环,导致警告控制器不能销毁"
    UITextField *textField = alertA.textFields.firstObject;

   UIAlertAction *ok = [UIAlertActionactionWithTitle:@"确定"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction* _Nonnull action) {
       
       hero.
name= textField.text;
        [
self.tableViewreloadData];
       
//        [self.tableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
//        [alertA dismissViewControllerAnimated:NO completion:nil];
    }];

0 0
原创粉丝点击