-
First add one
UITextFieldandUILabelto storyboard / nib -
Now assign
IBOutletforUILabel(Here I have used myLabel) -
Assign
UITextFieldDelegateto file owner, also implement the same delegate in .h file -
Use these lines of code:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSString *newString = [textField.text stringByReplacingCharactersInRange:range withString:string]; [self updateTextLabelsWithText: newString]; return YES; } -(void)updateTextLabelsWithText:(NSString *)string { [myLabel setText:string]; }