我使用了startMonitoringSignificantLocationChanges方法来定位当前位置。如果设备静止不动,但在行驶和更换电池塔时没有响应,它的工作正常。
它获得了初始回调。我正在使用这种方法
-(void)UpdateOwnLocation{
[locationManager stopMonitoringSignificantLocationChanges];
[locationManager startMonitoringSignificantLocationChanges];
}
在每个定期间隔后调用,但在旅行时不更新位置。 我试图用 -
替换方法-(void)UpdateOwnLocation{
//[locationManager stopMonitoringSignificantLocationChanges];
//[locationManager startMonitoringSignificantLocationChanges];
[locationManager stopUpdatingLocation];
[locationManager startUpdatingLocation];
}
并且该过程正在后台执行。
答案 0 :(得分:0)
如果设备静止不动?你是说你得到了最初的回调,但没有后续的回调?
你应该注意的事情:
有一个bug in CoreLocation in 4.1。基本上如果你的应用程序在后台,那么当核心位置试图唤醒你时它会崩溃。显然它已在4.2中修复。