I have 2 UITextField in a ViewController. One calls UIDatePicker, the other calls KeyBoard (numeric keypad). Then I assign user inputs to two class variables, the NSDate variable and the NSNumber variable, as follows.
-(void)textFieldDidEndEditing:(UITextField *)textField{
if (textField == self.datePickerTextField){
self.xxTime = self.datePicker.date;
NSLog(@"...%@",self.xxTime);
}
if (textField == self.numberTextField) {
int val = [textField.text intValue];
self.xxNumber = [NSNumber numberWithInt:val];
NSLog(@"...%@",self.xxNumber);
}
}
If I first touch datePickerTextField and then numberTextField, this method will not be called after the input in numberTextField is complete.
So my question is: how do I get this method to get a call? Should I specify "resignFirstResponder" somewhere?
TIA
source
share