tableview 编辑状态设置
#pragma mark - tableview 编辑状态设置
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
} - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleDelete;
} -(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"删除";
} -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"编辑操作");
if (editingStyle == UITableViewCellEditingStyleDelete) {
// NSUInteger row = [indexPath row];
// [self.dataArray removeObjectAtIndex:row];
NSMutableDictionary * dics = [self.dataDictionary objectForKey:KEY_SECTION(indexPath.section)];
CELL_STRUCT * cellstruct = [dics objectForKey:KEY_INDEXPATH(indexPath.section, indexPath.row)];
PengChanelChat *pcc = (PengChanelChat *)cellstruct.object;
[[MIChatModel sharedInstance] removeOneChaterNoSignal:[NSString stringWithFormat:@"%@",pcc.m_cid]];
[dics removeObjectForKey:KEY_INDEXPATH(indexPath.section, indexPath.row)];
[self.dataDictionary setObject:dics forKey:KEY_SECTION(indexPath.section)]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationAutomatic];
}
}
tableview 编辑状态设置的更多相关文章
- TableView编辑状态下跳转页面的崩溃处理
29down votefavorite 12 I have a viewController with a UITableView, the rows of which I allow to edit ...
- div可编辑状态设置
<div contentedittable="ture"></div>
- iOS开发UI篇-tableView在编辑状态下的批量操作(多选)
先看下效果图 直接上代码 #import "MyController.h" @interface MyController () { UIButton *button; } @pr ...
- EditText设置可以编辑和不可编辑状态
1.首先想到在xml中设置android:editable="false",但是如果想在代码中动态设置可编辑状态,没有找到对应的函数 2.然后尝试使用editText.setFoc ...
- Java中如何设置表格处于不可编辑状态
代码片段如下: 这样的话就可以将表格设置为不可编辑状态
- Easyui 设置datagrid 进入编辑状态,保存结束编辑
在datagrid中如何实现让一行进入编辑状态,修改数据后,保存信息呢? //点击列表变成文本框,进入可编辑状态 $(function () { var doc = $(document), tabl ...
- TFS中设置任务中的“计划开始时间”为可编辑状态
问题现象 如果使用TFS系统的默认模板CMMI新建团队项目,你会发现在网页浏览器中,任务工作项的"计划开始日期"和"计划结束日期"的类型是普通字符,并且不能修改 ...
- [C1] C1ComboBox 的非编辑状态优化
一.前言 先看看 WPF 自带的 ComboBox 在非编辑状态,自定义 ItemTemplate 的情况下,效果如下图所示: 其当前选中的项(红框内)与自定义的 ItemTemplate 一样: 但 ...
- ArcGIS学习记录—ArcGIS ArcMap编辑状态中线打断的问题
摘要:在处理数据时,我们经常会遇到线打断的问题,比如需要指定在线上某处打断线,或者新建网络数据集时需要在线的交点处打段线等等.现将桌面版中我所遇到的线打断的工具总结如下: 在ArcGIS矢量处理数据时 ...
随机推荐
- HTTP 返回时间 概念 TTFB..
课外学习部分: 什么是TTFB呢? 1.TTFB (Time To First Byte),是最初的网络请求被发起到从服务器接收到第一个字节这段时间,它包含了 TCP连接时间,发送HTTP请求时间和获 ...
- 洛谷 P1004 方格取数
题目描述 设有N*N的方格图(N<=9),我们将其中的某些方格中填入正整数,而其他的方格中则放 人数字0.如下图所示(见样例): A 0 0 0 0 0 0 0 0 0 0 13 0 0 6 0 ...
- HTTPClient实现java自动登录人人网
参考网址: https://passport.csdn.net/account/login http://www.iteye.com/topic/638206 httpClient http://b ...
- 【设计模式 - 18】之备忘录模式(Memento)
1 模式简介 备忘录模式的定义: 备忘录模式保存一个对象的某个状态,以便在适当的时候恢复对象,用作"后悔药",即取消上次操作或返回到以前的某个版本. 备忘录模式的应用实例 ...
- PHP+IIS7+PHPMangerForIIS搭建开发环境
准备工作 1.安装IIS 2.安装php 3.安装phpmanager 准备工作做好后,开始搭建环境 1.在Internet信息服务管理器下找到PHPManager 2.点击Register new ...
- struts 2学习笔记—浅谈struts的线程安全
Sruts 2工作流程: Struts 1中所有的Action都只有一个实例,该Action实例会被反复使用.通过上面Struts 2 的工作流程的红色字体部分我们可以清楚看到Struts 2中每个A ...
- iOS安全攻防(三):使用Reveal分析他人app
使用Reveal分析他人app 准备工作 1)已越狱的设备,而且已安装了OpenSSH,MobileSubstrate等有用工具(Cydia源里安装) 2)本地已安装了Reveal 操作步骤 1)拷贝 ...
- syslog实例详解rsyslog
http://blog.csdn.net/chenhao112358/article/details/40892239http://www.cnblogs.com/blueswu/p/3564763. ...
- UVa 993: Product of digits
这道题很简单.先将N用2,3,5,7(即10以内的素数)分解因数(需要先特殊判断N不为1),然后将可以合并的因数合并(如2*2合并成4,)这样求得的结果位数会减少,大小肯定会小一些.具体实现见代码. ...
- iOS-UIResponse之事件响应链及其事件传递
UIResponse之事件响应链及其事件传递 我们的App与用户进行交互,基本上是依赖于各种各样的事件.一个视图是一个事件响应者,可以处理点击等事件,而这些事件就是在UIResponder类中定义的. ...