【问题标题】:CLLocationManger: Did update location is not being calledCLLocationManger:没有调用更新位置
【发布时间】:2014-08-13 14:42:48
【问题描述】:

我正在实现基于位置的应用程序。在我的应用程序中,我使用以下方法。

  - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations


  -(void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading

以下是我在 ViewDidLoad 中的代码

 - (void)viewDidLoad 
{
    [super viewDidLoad];

    self.mapView.showsUserLocation = YES;

    self.locationManager=[[CLLocationManager alloc] init];
    self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    self.locationManager.delegate=self;

    [self.locationManager startUpdatingHeading];
}

这里我的问题是调用了 didUpdateHeading 方法,但没有调用 didUpdateLocations。我检查了是否有删除。谁能帮我解决这个问题?

【问题讨论】:

    标签: mkmapview mapkit cllocationmanager ios7.1


    【解决方案1】:

    您调用了startUpdatingHeading,因此您获得了航向更新,您没有调用startUpdatingLocation,因此您没有获得位置更新。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-27
      • 1970-01-01
      • 2020-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多