Q:

When Will textFieldDidEndEditing:textField be called?

I have 2 UITextField in a ViewController. One brings up a UIDatePicker another brings up a KeyBoard(number pad). I then assign user inputs to two class variables, a NSDate variable and a NSNumber variable, in the following method. 
-(void)textFieldDidEndEditing:(UITextField *)textField{
    if (textField == self.datePickerTextField){
        //update xxtime
        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 tap the datePickerTextField first then the numberTextField, this method won't get called after I finish typing in the numberTextField. 
So my question is how do I make this method to get called?  Should I specify "resignFirstResponder" somewhere? 
TIA

A:

It will invoke didEndEditing once another control gains focus 
According to the API,

This method is called after the text field resigns its first responder
  status.

So if you want didEndEditing to be invoked, you need to call
[textField resignFirstResponder];

