【问题标题】:startMonitoringSignificantLocationChanges method not respondingstartMonitoringSignificantLocationChanges 方法没有响应
【发布时间】:2010-10-13 04:55:38
【问题描述】:

我使用 startMonitoringSignificantLocationChanges 方法来定位当前位置。如果设备是静止的,但它在旅行时没有响应并且手机信号塔发生了变化,它工作正常。

它得到初始回调。我正在使用这种方法

-(void)UpdateOwnLocation{

[locationManager stopMonitoringSignificantLocationChanges];
[locationManager startMonitoringSignificantLocationChanges];

}

每隔一定时间间隔调用一次,但不会在旅行时更新位置。 我试图用-

替换该方法
-(void)UpdateOwnLocation{

//[locationManager stopMonitoringSignificantLocationChanges];
//[locationManager startMonitoringSignificantLocationChanges];

    [locationManager stopUpdatingLocation];
[locationManager startUpdatingLocation];  
      
}

并且进程正在后台执行。

【问题讨论】:

    标签: iphone cllocationmanager


    【解决方案1】:

    如果设备是静止的,它可以工作吗?你的意思是你得到了最初的回调,但没有后续的回调?

    您应该注意的事项:

    有一个bug in CoreLocation in 4.1。基本上,如果您的应用程序在后台,那么当核心位置试图唤醒您时它会崩溃。显然它在 4.2 中已修复。

    【讨论】:

      猜你喜欢
      • 2018-10-09
      • 2015-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-11
      • 2011-10-29
      相关资源
      最近更新 更多