title: Enable UIBarButtonItem if multiple UITextFields are all populated
body: <p>I have 3 UITextFields in a grouped UITableView and am trying to figure out the correct logic to only have my 'Save' UIBarButtonItem enabled when none of the UITextFields are empty.</p>
  
  <p>I'm currently using the <code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string</code> UITextField delegate method to detect changes to the field character by character, but it is providing inconsistent results.</p>
  
  <p>Any ideas?</p>
  
  <p>Edit: Here is the code I'm now using. As you can see I've placed my text fields into an array so I can iterate through them. As it is now, the save button doesn't enable until I enter the 2nd character in the 3rd field. Also it alternates enabled/disabled as a remove characters one by one from the fields.</p>
  
  <pre><code>NSString *newString = [textField.text stringByReplacingCharactersInRange:range withString:string];
  
      BOOL allValid;
  
      if (newString.length)
      {
          // Cycle through array checking for completeness
          for (int i = 0; i &lt; [textFieldArray count]; i++)
          {
              if ([[[textFieldArray objectAtIndex:i] text] length] &gt; 0)
              {
                  allValid = YES;
                  NSLog(@"TextField #%i Validates.", i);
              }
              else
              {
                  allValid = NO;
                  NSLog(@"TextField #%i Does Not Validate.", i);
              }
          }
      }
      else
      {
          NSLog(@"Invalid");
          allValid = NO;
      }
  
      if (allValid)
          [saveButton setEnabled:YES];
      else
          [saveButton setEnabled:NO];
  
      return YES;
  </code></pre>