Iphone startMonitoringSignificantLocationChanges方法没有响应
我已经使用startMonitoringSignificantLocationChanges方法来定位当前位置。如果设备处于静止状态,但在移动过程中没有响应,并且电池塔发生变化,则其工作正常 它得到初始回调。我正在使用这种方法Iphone startMonitoringSignificantLocationChanges方法没有响应,iphone,cllocationmanager,Iphone,Cllocationmanager,我已经使用startMonitoringSignificantLocationChanges方法来定位当前位置。如果设备处于静止状态,但在移动过程中没有响应,并且电池塔发生变化,则其工作正常 它得到初始回调。我正在使用这种方法 -(void)UpdateOwnLocation{ [locationManager stopMonitoringSignificantLocationChanges]; [locationManager startMonitoringSignificantLocati
-(void)UpdateOwnLocation{
[locationManager stopMonitoringSignificantLocationChanges];
[locationManager startMonitoringSignificantLocationChanges];
}
每次定期调用,但不在旅行时更新位置。
我试图用另一种方法来代替这种方法-
-(void)UpdateOwnLocation{
//[locationManager stopMonitoringSignificantLocationChanges];
//[locationManager startMonitoringSignificantLocationChanges];
[locationManager stopUpdatingLocation];
[locationManager startUpdatingLocation];
}
并且该过程是在后台执行的。如果设备处于静止状态,它会工作吗?你的意思是你得到了最初的回调,但没有后续的回调 您应该注意以下事项: 有一个问题。基本上,如果你的应用程序在后台,那么当核心位置试图唤醒你时,它就会崩溃。显然它在4.2中是固定的