title: iPhone scrolling the view up when keyboard is open
body: <p>I understand that this problem is incredibly common and I have read through quite a few answers but am having trouble understanding how the code works.  This works:</p>
  
  <pre><code>-(void)textFieldDidBeginEditing:(UITextField *)sender
  {
  if ([sender isEqual:txtLeaveAddyLine1])
  {
      //move the main view, so that the keyboard does not hide it.
      if  (self.view.frame.origin.y &gt;= 0)
      {
          [self setViewMovedUp:YES];
      }
  } 
  }
  </code></pre>
  
  <p>In this example, txtLeaveAddy is the very first UITextField that is hidden by the keyboard and it works like a charm.  As I cycle through the text fields on the screen it scrolls up when the user enters into that txtLeaveAddyLine1 field.  However, when I try to add the fields below the txtLeaveAddyLine1 field - nothing happens.  For example:</p>
  
  <pre><code>-(void)textFieldDidBeginEditing:(UITextField *)sender
  {
      if ([sender isEqual:txtLeaveAddyLine1])
      {
          //move the main view, so that the keyboard does not hide it.
          if  (self.view.frame.origin.y &gt;= 0)
          {
              [self setViewMovedUp:YES];
          }
      } 
      if ([sender isEqual:txtLeaveAddyLine2])
      {
          //move the main view, so that the keyboard does not hide it.
          if  (self.view.frame.origin.y &gt;= 0)
          {
              [self setViewMovedUp:YES];
          }
      } 
  }
  </code></pre>
  
  <p>Am I not using this function correctly?</p>