I have a segmented control with 3 options to save standard/satellite/hybrid maps in the NSUserDefaults. One problem I'm having is that the segmented control changes back to the first segment whenever the mapSettingsViewController is re-visited. The other problem is that mapViewController doesn't reload on viewWillAppear. 

I'm using a pageCurl modal transition with Storyboarding - not sure if that matters.

this is the code in settings view controller (mapSettingsViewController) to save the segmented selection:

```
    - (IBAction)changeMapType: (id)sender{

    NSInteger index = ((UISegmentedControl*)sender).selectedSegmentIndex;

    // Get the shared defaults object.
    NSUserDefaults *mapUserPreferences = [NSUserDefaults standardUserDefaults];

    if(segmentedControlMapType.selectedSegmentIndex == 0){
        // Save the index.
    [mapUserPreferences setInteger:index forKey:@"mapViewKey"];

    }
    else if(segmentedControlMapType.selectedSegmentIndex == 1){
        // Save the index.
        [mapUserPreferences setInteger:index forKey:@"mapViewKey"];
    }
    else if(segmentedControlMapType.selectedSegmentIndex == 2){
        // Save the index.
        [mapUserPreferences setInteger:index forKey:@"mapViewKey"];

    }

    // Write them to disk
    [mapUserPreferences synchronize];
}

```

then in the first view controller (mapViewController) to display the change to the map base on which segment was chosen by the user. I put the code in viewWillAppear so the map is reloaded when the view appears each time.

```
    -(void) viewWillAppear:(BOOL)animated {

    // Get the settings and set the selected index.
    NSUserDefaults *mapUserPreferences = [NSUserDefaults standardUserDefaults];
    if([mapUserPreferences integerForKey:@"mapViewKey"] == 0) {
        mapView.mapType = MKMapTypeStandard;
    }
    if([mapUserPreferences integerForKey:@"mapViewKey"] == 1) {
        mapView.mapType = MKMapTypeSatellite;
    }
    if([mapUserPreferences integerForKey:@"mapViewKey"] == 2) {
        mapView.mapType = MKMapTypeHybrid;
    }

}

```

thanks for any help :)