switch between limited textfields
===

I would like to write 4 numbers in a textfield (`codeA`) an if there are 4 numbers inside I want to select another field (`codeB`). I want codeB to be also limited to 4 numbers. but if I make it a delegate of View Controller, the application crashes.
my code in .h:

    @property (weak, nonatomic) IBOutlet UITextField *codeA;
    @property (weak, nonatomic) IBOutlet UITextField *codeB;
my code in .m:

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
    if ([codeA.text length] > 3) {
        codeA.text = [textField.text substringToIndex:4];
        [codeB becomeFirstResponder];
        return NO;
    }
    if ([codeB.text length] > 3) {
        codeB.text = [codeB.text substringToIndex:4];
        return NO;
    }
    
    return YES;
    }
if `codeB` is not delegate of View Controller it works, but B isn't limited.
