注意:reloadData 只有在View 中的数据发生改变的情况下。
UIAlertActionStyleCancel------Cancel意思是取消
UIAlertActionStyleDefault------正常情况下使用
UIAlertController * alertController=[UIAlertController alertControllerWithTitle:@"提示" message:@"是否删除?" preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//数组按下表删除
[arrayPic removeObjectAtIndex:indexPath.row];
//刷新页面
[_collectionView reloadData];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[self presentViewController:alertController animated:NO completion:nil];