Good day. It is necessary to compare a string from an array with a UITextField so that it returns TRUE only when the word is entered correctly.

    1 answer 1

    The object of the UITextField class must specify a delegate, for example, the current class:

     self.textField.delegate = self; 

    The current class needs to implement the textField:shouldChangeCharactersInRange:replacementString: UITextFieldDelegate delegate method .

     - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { // Будет вызван каждый раз, когда меняется хотя бы один символ в текстфилде. return YES; } 

    From official documentation:

    The text field calls this method each time a user enters a new character or deletes an existing one.

    • @Yurjke please! If the answer helped, then please add it and mark it as correct. :) - Vladimir Obrizan
    • one
      Plus, wrote that + will be added only when the reputation is 15 :)) - Yurjke