Hi, i'm trying to clear a UITextField whenever the UIControlEventEditingChanged
event is being performed.
However, when I set the text to nothing, the UIControlEventEditingChanged
event is being called again, and this is the way it keeps going.
This is my code:
- (void)updateText {
//other code
textfield.text = @"";
//other code
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[textfield addTarget:self action:@selector(updateText) forControlEvents:UIControlEventEditingChanged];
}
I would like to be able to set the text of the text field without it looping infinitely!
Any help appreciated.