ios tableview cell 侧滑删除
来源:互联网 发布:淘宝店铺头像在哪里换 编辑:程序博客网 时间:2024/05/01 20:51
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return TRUE;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
returnUITableViewCellEditingStyleDelete;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
NSInteger row=[indexPath row];
NSString *path = [NSStringstringWithFormat:@"%@/Documents/save.dat",NSHomeDirectory()];
NSData *data1 = [NSDatadataWithContentsOfFile:path];//读取文件
NSMutableArray* array1 = [NSKeyedUnarchiverunarchiveObjectWithData:data1];//反序列化
[array1 removeObjectAtIndex:row];
NSMutableArray* array=[[NSMutableArrayalloc]initWithArray:array1];
NSData* data2=[NSKeyedArchiverarchivedDataWithRootObject:array];
[data2 writeToFile:pathatomically:YES];
_datalist=array1;
[_tablereloadData];
}
在上面的函数里面写数据更新的操作。。。。。
- ios tableview cell 侧滑删除
- iOS开发,删除tableView的cell
- IOS TableView 左滑动删除Cell方法
- iOS tableView editCell 删除Cell 置顶Cell NSIndexPath写法
- tableView的左滑删除某个cell
- TableView删除某个cell
- tableView cell 删除置顶
- 关于tableView 删除cell
- iOS 使用cell的删除功能,实现tableview的代理
- iOS tableview自定义cell
- tableView左滑删除,自定义标题+cell长按手势
- tableView cell 左滑点击删除等点击按钮
- IOS TableView Cell重用机制及TableView
- iOS TableView Cell重用机制及TableView
- ios自制tableview的cell
- ios自制tableview的cell
- iOS 通过cell找到TableView
- ios tableview自动跳到某行cell
- 对io流学习的简单总结
- 007、第七讲 资源管理:声音文件 总结【unity3d如何添加播放音乐】
- 算法笔记之 全排列算法 一 递归求解
- 文件编程(2)底层文件IO操作
- 使用MFC的CFile文件类和CArchive串行化类进行二进制文件读写操作
- ios tableview cell 侧滑删除
- 每天一个linux命令(36):diff 命令
- 开启博客之旅
- 浅谈我对IO流的了解 - 字符流缓冲区
- 解决easyui 中显示Date类型数据为[object Object],json中格式化日期
- easyUI 动态添加窗体
- linux apt-get
- 二叉树
- ubuntu12.04删除文件或文件夹