title: Accessing textfield.text in an NSArray by index
body: <p>I have an array of text fields. I'm using a <code>for</code> loop to go through the array and check to see if the text field's text attribute is empty. </p>
  
  <pre><code>NSArray *arrayOfTextFields = [NSArray arrayWithObjects: _nameTextfield, _emailTextfield, _phoneTextfield, _termTextfield, _schoolTextfield, _graduationTextfield, _gpaTextfield, _degreeTextfield, _interestTextfield, _groupTextfield, _appliedTextfield, nil];
  
  for (int i = 0; i &lt; [arrayOfLabels count]; i++) {
  
      if ([[arrayOfTextFields objectAtIndex:i] isEqualToString:@""]) {
          NSLog(@"if statement ran");
      }
  }
  </code></pre>
  
  <p>Obviously the <code>if</code> statement does not run because it is comparing a text field to a string. I can't figure out how to do this syntactically in Objective-C. Something like this would be incredibly easy in C++ or Java, it might look something like <code>arrayOfTextFields[i].text == "";</code> That is essentially what I'm trying to do. I have struggled to find references to the sort of thing online.</p>