我正在开发一个应用程序,它涉及跟踪新位置和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