views:

53

answers:

1

How do I get the delete button to show when swiping on a uitableviewcell?

I have followed this post: http://discussions.apple.com/thread.jspa?threadID=1569862 but the event is never raised and the delete button never appears?!

A: 
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return YES if you want the specified item to be editable.
    return YES;
}

// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        //add code here for when you hit delete
    }    
}
Kurbz
Thank you! I was literally about to rip my head off with frustration lol
TheLearner
lol you're welcome
Kurbz