Weird locations from CLLocationManager in iOS9

淺唱寂寞╮ 提交于 2019-12-13 07:16:36

问题


I have developed a walk app that can record distance, on iOS7, iOS8, the distance is mostly fine although sometimes not accurate, but on iOS9.0, the distance often too large, so I check

- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)

Locations method, and find some time get locations like this: A、B、C, but coordinate of C is equal to A, which i think is weird

I find startUpdatingLocation called every seconds, after get rid of it , it gets better, but still happens

here is the demo source code


回答1:


For ios 9, you have to set allowsBackgroundLocationUpdates.



来源:https://stackoverflow.com/questions/33147568/weird-locations-from-cllocationmanager-in-ios9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!