title: how to clear uiableviewcell
body: <p>Hi I have a single section of custom uitableview cells, which I am assigning values from a subview when they are chosen by the user.</p>
  
  <p>The custom cell is made up of two textlabels, one a title the other is where the chosen element from the subview will be assigned (while its not assingned it has the string "empty" assigned to it.</p>
  
  <p>I would like to have the option to swipe a single cell and then enable the user to clear the contents of the uilabel back to "empty" if the user has assigned a value to it.</p>
  
  <p>I have tried to do this, and have got it working to a point, however I am having issues with the uitableview becoming unresponsive untill the user touches the tableview again.. then it works like normal.</p>
  
  <p>This is my implementation, I would like to know if this is the only way or if their is a better way of doing this, as I am having issues with responsiveness of the table once I have used a swipe.</p>
  
  <pre><code>- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      return @"Clear";
  }
  
  // Override to support editing the table view.
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if (editingStyle == UITableViewCellEditingStyleDelete) {
  
         //Clears the correct uitableviewcell and releases the correct nsstring in the view 
          if (indexPath.section == 0) {
              if (indexPath.row == 0) {
                  //reset uitableviewcell textlabel with default input "empty"
              vehicleSearchCell = [tableView cellForRowAtIndexPath:indexPath];
              UILabel *label2;
              label2 = (UILabel *)[vehicleSearchCell viewWithTag:2];
              label2.text = @"empty";
              [tableView reloadData]; //may or may not need to call this now
              }
              else if (indexPath.row == 1) {
                  //reset uitableviewcell textlabel with default input "empty"
              }
              else if (indexPath.row == 2) {
                  //reset uitableviewcell textlabel with default input "empty"
              }
              else (indexPath.row == 3) {
                  //reset uitableviewcell textlabel with default input "empty"
  
              }
  
          } 
      }
  }
  </code></pre>
  
  <p>Future update.
  I also  have another custom cell I am using for a button (the custom cell has a button in it) and the user is also able to swipe this (which i dont want however) the clear button also shows on this but after the clear button has been used (which obviously dose nothing) you can press another cell first time, there is no delay.. but if you are to do it with any of the cells in section 0 then you get the unresponsiveness.. 
  <img src="https://i.stack.imgur.com/ayUew.png" alt="enter image description here"></p>
  
  <p>Update
  I am starting to think its the way I am loading my cells using tags etc.. do you guys thing this might be causing the problem? if so how can I solve this..</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"Cell";
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
      if (cell == nil) {
          [[NSBundle mainBundle] loadNibNamed:@"VehicleSearchCell" owner:self options:nil];
          cell = vehicleSearchCell;
          self.vehicleSearchCell = nil;
      }
      // Configure the cell...
      cell.selectionStyle = UITableViewCellSelectionStyleNone;
  
      if(indexPath.section == 0)
      {
          if(indexPath.row == 0)
          {
              UILabel *label1;
              label1 = (UILabel *)[cell viewWithTag:1];
              label1.text = @"Manufacture";
  
              UILabel *label2;
              label2 = (UILabel *)[cell viewWithTag:2];
              label2.text = manufactureSearchObjectString;
          }
          else if(indexPath.row == 1)
          {
              [[NSBundle mainBundle] loadNibNamed:@"VehicleSearchCellDual" owner:self options:nil];
              cell = vehicleSearchCellDual;
              self.vehicleSearchCellDual = nil;
  
              UILabel *label;
              label = (UILabel *)[cell viewWithTag:1];
              label.text = @"Model";
  
              UILabel *label2;
              label2 = (UILabel *)[cell viewWithTag:2];
              label2.text = @"empty";
  
              UILabel *label3;
              label3 = (UILabel *)[cell viewWithTag:3];
              label3.text = @"empty";
          }
          else if(indexPath.row == 2)
          {
              UILabel *label;
              label = (UILabel *)[cell viewWithTag:1];
              label.text = @"Year";
  
              UILabel *label2;
              label2 = (UILabel *)[cell viewWithTag:2];
              label2.text = @"empty";
          }
          else if(indexPath.row == 3)
          {
              UILabel *label;
              label = (UILabel *)[cell viewWithTag:1];
              label.text = @"Key type";
  
              UILabel *label2;
              label2 = (UILabel *)[cell viewWithTag:2];
              label2.text = keyTypeSearchObjectString;
          }
      }
      else if(indexPath.section == 1)
      {
          if(indexPath.row == 0)
          {
              [[NSBundle mainBundle] loadNibNamed:@"VehicleSearchButtonCell" owner:self options:nil];
              cell = searchButtonCell;
              self.searchButtonCell = nil;
          }
      }
      return cell;
  }
  </code></pre>