我正在開發一個應用程序,它涉及跟蹤新位置和X分鐘服務器更新。當time diff等於或大於X mins時,我停止位置更新,然後發送到服務器,如果位置小於X mins,則開始更新位置。但didUpdateToLocation委託方法在小於X mins時不會被調用。CLLocationManager不調用它的委託方法
我在這裏發佈我的代碼:
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
if (theDiff > 10.0f || myDate == nil)
{
[self stopUpdating];
}
else
{
[self.mLocationManager startUpdatingLocation];
}
}
您是否在.h中添加了? –
iMeMyself
是的,我在我的.h文件中添加了 – Sharme
我的意思是協議?即UIViewController –
iMeMyself