iPhone how to get UITextField’s text while typing?

  1. First add one UITextField and UILabel to storyboard / nib

  2. Now assign IBOutlet for UILabel (Here I have used myLabel)

  3. Assign UITextFieldDelegate to file owner, also implement the same delegate in .h file

  4. 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];
     }
    

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)