I get the user location from this method
MKCoordinateRegion region; MKCoordinateSpan span; span.latitudeDelta=0.2; span.longitudeDelta=0.2; CLLocation *location1 = [locationManager location]; CLLocationCoordinate2D location = [location1 coordinate]; location.latitude = location.latitude; location.longitude = location.longitude; region.span=span; region.center = location; MKReverseGeocoder *geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:location]; geoCoder.delegate = self; [geoCoder start]; mapView.showsUserLocation = TRUE; [mapView setRegion:region animated:TRUE]; [mapView regionThatFits:region];
This works fine, but when I try to run this code in the simulator, it breaks at the point [mapView setRegion:region animated:TRUE]; , this suggests that it does not receive the latitude and longitude values. So, how can I do this code in the simulator perfectly.
I need to make this code run in the simulator, is this possible?
source share