delete a Table-View row


/ Published in: iPhone
Save to your folder(s)



Copy this code and paste it in your HTML
  1. [tableView setEditing:YES];
  2.  
  3. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
  4. int chapter = [[[book bookmarks] objectAtIndex: indexPath.row] intValue];
  5. [book removeBookmark: chapter];
  6. [tableView deleteRowsAtIndexPaths: [NSArray arrayWithObject: indexPath] withRowAnimation: UITableViewRowAnimationFade];
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.