,
[textField addTarget:self action:@selector(compareInput) forControlEvents:UIControlEventEditingChanged];
-(void)compareInput
{
if ([textField.text isEqualToString:compareString])
NSLog(@"They're the same!");
}
:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
, . string .
, , , foo UITextField:
: f, :
[textField addTarget:self action:@selector(compareInput) forControlEvents:UIControlEventEditingChanged];
compareInput , f textField.text:
-(void)compareInput
{
NSLog(textField.text);
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSLog(textField.text);
return YES;
}
: o, :
[textField addTarget:self action:@selector(compareInput) forControlEvents:UIControlEventEditingChanged];
compareInput , fo textField.text:
-(void)compareInput
{
NSLog(textField.text);
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
NSLog(textField.text);
return YES;
}
, , , , !