Take a look at UITextFieldDelegate
. It will give you the method callbacks you want, such as textfieldDidEndEditing
. It should pass the text field which you can then identify by object comparison or tag value.
UPDATE
Code sample for the delegate callback. Be sure to add UITextFieldDelegate
to your .h file. Also specific your textField's delegate property, textField.delegate = self
in your code or in IB.
- (void)textFieldDidEndEditing:(UITextField *)textField {
if (textField.returnKeyType == UIReturnKeyDone) {
// the textfield with the Done return key is what I care about
self.value2 = [textField.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
}
}