Not updating the current location in MKMapView

瘦欲@ 提交于 2019-12-07 01:19:33

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!