title: Set Maximum Length of Multiple TextFields
body: <p>I found this code from another stack overflow post</p>
  
  <pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
      NSUInteger upperRightLength = [upperRight.text length] + [string length] - range.length;
      return (upperRightLength &gt; 1) ? NO : YES;
          }
  </code></pre>
  
  <p>I need to run this same code (which works great) on more than one textField..</p>
  
  <p>I tried this but it did not seem to run correctly, and did not have the same effect!</p>
  
  <pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
      NSUInteger upperRightLength = [upperRight.text length] + [string length] - range.length;
      return (upperRightLength &gt; 1) ? NO : YES;
  
      NSUInteger upperLeftLength = [upperLeft.text length] + [string length] - range.length;
      return (upperLeftLength &gt; 1) ? NO : YES;
  }
  </code></pre>
  
  <p>I don't know what else to do! Thank you so much for your help!!</p>
  
  <p>EDIT:
  I have now tried another code:</p>
  
  <pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
      NSUInteger upperRightLength = [upperRight.text length] + [string length] - range.length;
      NSUInteger upperLeftLength = [upperLeft.text length] + [string length] - range.length;
      return (upperLeftLength &gt; 1 &amp;&amp;  upperRightLength &gt; 1 ) ? NO : YES;
  }
  </code></pre>
  
  <p>Now the same thing seems to happen. Which ever text field I click on first (lets say upperLeft) I am still able to type as many characters as I want. But then when I click on the other textfield (upperRight) I am only able to type 1 character. I have tried starting with the (upperRight) first and I see the same results... where the (upperRight) will allow me to type as many as I want, and the (upperLeft) will only allow me to type 1 character! This is so weird!! Thank you for your help!!</p>