I have a MKMapView & I use it to display user’s current location. It works normal when I first load it in the App. But when I press Home button to put the App to background & call it back from background, the map prompts it is unable to find the user’s location.
I was thinking is the MKMapView takes time to search for user’s location, and when I call it back from background, it does not have enough time to load the location service ?
iOS5 SDK, xCode 4.3 is used.
If I understand your question correctly, your problem is that when your app resumes (becomes active),
mapView.userLocationreturns nil. Although I haven’t tested this, I suspect it is because the mapView will need some time to relocate the user. You can get around this by adding your logic to the appropriate delegate method instead, which is- (void) mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation, if memory serves me right (you might want to verify that, though).EDIT: Make sure you test location-related code on a device, since its behaviour might differ from the simulator.