IOS开发问题求教高人,UITableVIewCell的删除,点击图中红色圆圈按钮的时候发生的是什么事件?

2025年05月07日 19:23
有1个网友回答
网友(1):

点击后右边会出现删除按钮
-(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath

{

return YES;

}
自定义删除按钮

- (NSString *)tableView:(UITableView *)tableView

titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath

{

NSString * a = @"删除";

return a;

}
删除按钮的回调函数
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

{