I have a view with several `UITextFields` in it. I also have a high level `UISegmentController` that changes the view. When I enter text in a field, then press the hide keyboard button, then change segemnents, it saves fine. But when I enter text, and don't press the release keyboard button, then switch segments, it does not save the text.

How can I fix this?

Here is some of the code for the `UITextField` in my custom `UITableViewCell`:

```
- (IBAction)col2_doubleValueChanged:(id)sender
{
    NSString *newValue = [NSString stringWithFormat:@"%@/%@", self.col2_doubleEntryValue_1.text, self.col2_doubleEntryValue_2.text];
    NSMutableDictionary *result = [[[NSMutableDictionary alloc] init] autorelease];
    [result setValue:self.row_key forKey:@"row_key"];
    [result setValue:@"1" forKey:@"column"];
    [result setValue:newValue forKey:@"col2_value"];
    [[self delegate] editDidFinish:result];
    [[self delegate] valueChanged];
}

- (IBAction)col2_singleValueEditDidBegin:(id)sender
{
}

```

![enter image description here](https://i.stack.imgur.com/q8Rtd.png)

Edit:

```
- (void)valueChanged
{
    self.dirtyFlag = 1;
}

- (int)saveDataToServer
{
    [self.tableView resignFirstResponder];

    if (!dirtyFlag) {
        return 0;
    }    

    NSString *errors = [DataSource updatePatientWorkflowClinicalChecklistForAppointment:[[[DrChronoDataSource getCurrentAppointment] valueForKey:@"appointment_id"] intValue] clinicalInfo:self.clinicalChecklist checklistId:[self.clinicalChecklistId intValue] patientWorkflowServerId:patientWorkflowServerId];

    if ((NULL == errors) || ![errors isEqualToString: @""]) {
        //Show error messages.
        if (NULL == errors) {
            errors = @"Failed to save data to server.  Please retry.";
        }
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Status" message:errors delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
        [alert release];
        return -1;
    } else {
        [self dismissModalViewControllerAnimated:FALSE];
    }

    self.dirtyFlag = 0;
    return 0;
}

```