title: iOS UITextField not clearing when editing
body: <p>I have a standard UITextField that I have added to a UITableViewCell and whenever I go to edit it, the text that is in it will not clear out. I have tried placing a placeholder and that too will not clear when editing. What's going on?</p>
  
  <pre><code>if (indexPath.row == 1) {
          cell.textLabel.text = @"Device ID";
          cell.accessoryType = UITableViewCellAccessoryNone;
          cell.selectionStyle = UITableViewCellSelectionStyleNone;
          deviceID = [[UITextField alloc] initWithFrame:CGRectMake(115, 11, 388, 22)];
          deviceID.delegate = self;
          deviceID.adjustsFontSizeToFitWidth = YES;
          deviceID.font = [UIFont boldSystemFontOfSize:15];
          deviceID.textColor = [UIColor blackColor];
          deviceID.autocorrectionType = UITextAutocorrectionTypeNo;
          deviceID.autocapitalizationType = UITextAutocapitalizationTypeNone;
          deviceID.textAlignment = NSTextAlignmentLeft;
          deviceID.clearButtonMode = UITextFieldViewModeWhileEditing;
          deviceID.keyboardType = UIKeyboardTypeDefault;
          deviceID.backgroundColor = [UIColor clearColor];
          deviceID.delegate = self;
          deviceID.clearsOnBeginEditing = YES;
          deviceID.text = [[NSUserDefaults standardUserDefaults] objectForKey:DEVICE_ID];
          [deviceID setEnabled:YES];
          [cell addSubview:deviceID];
      }
  
  - (BOOL)textFieldShouldClear:(UITextField *)textField {
  
      return YES;
  }
  </code></pre>