这里是增加了一个删除按钮的代码:如何在删除TableViewCell时删除按钮旁边的另一个按钮?
(BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSLog(@"delete pressed");
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
}
}
请访问此链接。 http://stackoverflow.com/questions/17254402/swipe-to-delete-and-the-more-button-like-in-mail-app-on-ios-7 –