4 digit code entry like in remote app
<p>I would to to do a 4 digit code entry like app does in the remote app to verify to iTunes library.
Currently have 4 UITextFields, but am running into problems automatically moving the cursor to the next text field.</p>

<p>Using this code currently but this moves the cursor then places the text in the new first responder instead of the correct one:</p>

<pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
    if ([string length] &gt; 0) {
        if (codeText1 == textField) {
            [codeText2 becomeFirstResponder];
        } else if (codeText2 == textField) {
            [codeText3 becomeFirstResponder];
        } else if (codeText3 == textField) {
            [codeText4 becomeFirstResponder];
        }
    }

    return YES;
}
</code></pre>
