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
a. Add the target and callback to the button (I presume you already did that)
b. In the callback function, loop over the superviews to find the UITableViewCell and then find the index of it, like so:
-(void)deleteButtonPressed:(UIButton*)button {
UIView* candidate = button;
while (![candidate isKindOfClass:[UITableViewCell class]]) {
candidate = candidate.superview;
}
NSIndexPath* indexPathToDelete = [self.tableView indexPathForCell:cell];
...
c. Update your model first (very important)
[self.dataArrayThatFeedsTableView removeObjectAtIndex:indexPathToDelete.item]
d. Call the delete row
[self.tableView deleteItemsAtIndexPaths:@[indexPathToDelete]];