How do I programmaticly assign a method (Observer?) to the "Did End On Exit" Event on a UITextField object?
This is easy enough to do in IB but I can't figure out how to do it in code...
How do I programmaticly assign a method (Observer?) to the "Did End On Exit" Event on a UITextField object?
This is easy enough to do in IB but I can't figure out how to do it in code...
In your view controller implement the following method:
- (void)textFieldDidEndEditing:(UITextField *)textField{
//do stuff
}
Don't forget to set the delegate in viewDidLoad or the initializer:
myTextField.delegate = self;
I just figured it out...
[mytextField addTarget:self
action:@selector(methodToFire:)
forControlEvents:UIControlEventEditingDidEndOnExit];