tags:

views:

23

answers:

1

Hi Guys,

I have a map View which loads from the world map and zoom to the user location. On the same View I have a button which takes me to Second view. When I go back from second view to Map view again, It again loads from World Map and zoom in to the User location which is not good. I want the Map should show the last zoomed in location when i go back from second view to Map view.

You can download rediATM App from AppStore and view the functionality what i want.

Please help.

A: 

Where do you load your annotations in your view? viewDidLoad? ViewWillAppear? It should be in viewDidLoad and not viewWillAppear if that is whrer you have it since viewWillAppear loads every time.

stitz
I am loading my annotations in ViewDidLoad. Below is the code - (void)viewDidLoad { [mapView setShowsUserLocation:YES]; [mapView setDelegate:self]; [super viewDidLoad]; } And Below is the code which I am using to go back to mapView from Second View. if(self.myMap == nil) { MyMap *viewController = [[MyMap alloc] initWithNibName:@"MyMap" bundle:nil]; self.myMap = viewController; [viewController release]; } [self.navigationController pushViewController:myMap animated:YES];
Amarpreet