title: Action sheet UIButton to process delete
body: <p>I have a UITableView in which I have files downloaded to from a UIWebView. Before my changes I had no issues deleting the row and from the local folder in which it was downloaded to.</p>
  
  <p>Since then I have implemented a multi select function. Pressing edit, selecting w/e files, pressing delete to show the action sheet works fine. But for the life of me I can't figure out how to make the action sheet process the delete action.</p>
  
  <p>Below I will post the code I'm working with.</p>
  
  <pre><code>//viewDidLoad:
  self.deleteButton = [[UIBarButtonItem alloc] initWithTitle:@"Delete" style:UIBarButtonItemStyleBordered target:self action:@selector(deleteButton:)];
  
  - (void)deleteButton:(id)sender
  {
      NSString *actionTitle = ([[self.tableView indexPathsForSelectedRows] count] == 1) ?
      @"Are you sure you want to remove this item?" : @"Are you sure you want to remove these items?";
      UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:actionTitle delegate:self cancelButtonTitle:@"Cancel"
                                                 destructiveButtonTitle:@"OK" otherButtonTitles:nil];
      actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
      [actionSheet showInView:self.view];
  
  }
  
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
  
      if (editingStyle == UITableViewCellEditingStyleDelete){
  
          NSString *fileName = [directoryContents objectAtIndex:indexPath.row];
  
          NSString *path;
          NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
          path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"downloads"];
          path = [path stringByAppendingPathComponent:fileName];
          NSError *error;
  
      //Remove cell
          [directoryContents removeObjectAtIndex:indexPath.row];
          [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];
          //[tableView reloadData];
  
          if ([[NSFileManager defaultManager] fileExistsAtPath:path])     //Does file exist?
          {
              if (![[NSFileManager defaultManager] removeItemAtPath:path error:&amp;error])   //Delete it
              {
                  NSLog(@"Delete file error: %@", error);
              }
          }
      }
  }
  </code></pre>
  
  <p>Any info on how to link that "OK" button to finish the delete would be greatly appreciated.</p>