问题
I am using CLLocationManager to update the current location but some times the current location is lost. I don't know why the current location is losing.
Please help me out of this.
Thank you, Madan Mohan
回答1:
The location can become lost for a wide variety of reasons:
The device no longer has reasonably open access to the sky so GPS satellite information is unavailable.
There aren't enough cell towers available to perform triangulation.
The wifi access point isn't in the database of known access points.
The user switched to Airplane Mode.
And many more. Location-aware applications have to assume they'll lose geolocation information at any time. It often comes back moments later.
回答2:
If you didnt get any update on your location then this delegate might be called
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
switch([error code])
{
case kCLErrorLocationUnknown:
//The location manager was unable to obtain a location value right now
case kCLErrorDenied:
//Access to the location service was denied by the user
case kCLErrorNetwork:
//The network was unavailable or a network error occurred.
case kCLErrorHeadingFailure:
// The heading could not be determined.
}
You can find out whats the problem is.
来源:https://stackoverflow.com/questions/4334565/not-updating-the-current-location-in-mkmapview