Basically I want to delete row on click event of a button which is a part of that row.
I can not use commit editing style because i want to perform unsubscribe and dele
Tapping a row and deleting it should be possible in a way like this:
In your didSelectRowAtIndexPath
you can implement the following:
[myArrayWithSubscriptions removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
If you want to only tap the UIButton to delete use this code in the action behing the UIButton.
CGPoint point;
NSIndexPath *indexPath;
point = [sender.center locationInView:tableView];
indexPath = [tableView indexPathForRowAtPoint:point];
[myArrayWithSubscriptions removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
That way you have the indexPath from the cell that had its UIButton tapped, and should be able to continue to delete it. I'm typing this on the go and will check this code later for any typos.