objective-c UIAlertController 提示框应用

注意:reloadData  只有在View 中的数据发生改变的状况下。  数组

UIAlertActionStyleCancel------Cancel意思是取消spa

UIAlertActionStyleDefault------正常状况下使用3d




UIAlertController * alertController=[UIAlertController alertControllerWithTitle:@"提示" message:@"是否删除?" preferredStyle:UIAlertControllerStyleAlert];orm

    [alertController addAction:[UIAlertAction actionWithTitle:@"肯定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {rem

        //数组按下表删除it

        [arrayPic removeObjectAtIndex:indexPath.row];io

        //刷新页面im

        [_collectionView reloadData];数据

    }]];margin

    [alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];

    

    [self presentViewController:alertController animated:NO completion:nil];

相关文章
相关标签/搜索