问题描述
我正在开发一个可不断轮询用户位置的应用程序。在大多数设备上,返回到didUpdateLocations的位置是正确的,但在某些设备上,它是(0,0),尽管似乎一切都正确,例如权限,委托等。 didFailWithError永远不会被调用。 我只看到了几个这样的问题,但没有找到解决方案。 有什么想法吗?
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
spotGeofences = [NSMutableArray array];
[locationManager requestAlwaysAuthorization];
locationManager.distanceFilter = kCLdistanceFilterNone;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.activityType = CLActivityTypeOtherNavigation;
locationManager.pausesLocationUpdatesAutomatically = NO;
locationManager.allowsBackgroundLocationUpdates = YES;
locationManager.showsBackgroundLocationIndicator = TRUE;
- (void) locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if ([CLLocationManager locationServicesEnabled])
[locationManager startUpdatingLocation];
}
- (void) locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations {
//Here I get (0,0) :[
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)