鉴于各种购物车/联系人之类的cell会有“编辑-批量删除”的操作,故作此文,仅供参考。
* 为了保证cell的数据可以永久的改变,可以通过设置模型数据来进行改变
* 要控制cell的附加状态,就通过模型来设置,因为cell涉及到复用,会影响数据的改变


创建俩个按钮用来执行批量选择


下面是tableView的代理方法,此处我们主要用到的是:
1、- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
2、- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath



网友评论