title: Ipad delete button not working in UITextField
body: <p>I have a few UItextfields connected to delegates, which have the function deleteCharactersInRange, to delete comas. I just found out that if I start editing one of these fields, write any characters, and then I want to delete them, the iPad delete button the the keyboard is not working. it doesn't delete anything.</p>
  
  <p>Why??</p>
  
  <p>This is the code</p>
  
  <pre><code>- (BOOL)textField:(UITextField *)tf shouldChangeCharactersInRange:(NSRange)r replacementString:(NSString *)str
  {
      if (tf == namegroup) {
          if ([str isEqualToString:@","]) {
              return NO;
          }
          return YES;
      }
  
      if ([[newmessagename text] length] + [str length] - r.length &gt; 30) {
          return NO;
      } else {
          return YES;
      }
  
      if (tf != namegroup ||tf != newmessagename){
      return YES;
          }
  }
  </code></pre>