iOS:如何在不使用位置服务的情况下查找用户位置?

iOS:如何在不使用位置服务的情况下查找用户位置?,ios,gps,cllocationmanager,gprs,Ios,Gps,Cllocationmanager,Gprs,在iOS中,是否有其他方法可以获取用户位置并进行地理围栏,而不是使用位置服务。我这样问是因为,当我们启用定位服务时,电池消耗太高。这就是为什么我在寻找另一种选择。我可以尝试什么?如果您正在使用map,则无需实现位置服务代码来捕获当前位置,请将“是”设置为MKMapView的showUserLocation属性 [self.mapView设置显示位置:是]并实现其委托方法: - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MK

在iOS中,是否有其他方法可以获取用户位置并进行地理围栏,而不是使用位置服务。我这样问是因为,当我们启用定位服务时,电池消耗太高。这就是为什么我在寻找另一种选择。我可以尝试什么?

如果您正在使用map,则无需实现位置服务代码来捕获当前位置,请将“是”设置为MKMapView的showUserLocation属性 [self.mapView设置显示位置:是]并实现其委托方法:

- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
`

代表:

    - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{
    NSLog(@"Location Current : %@ ",userLocation.location);
    [self.mapView setCenterCoordinate:userLocation.location.coordinate animated:YES];
}

现在您可以享受当前位置:)

它被称为区域监控:但它当然不是很精确。在某些情况下,您需要跨越边界并在那里停留10秒左右,然后系统才会将其注册为区域跨越。区域监控使用更少的电池(因为它不太准确)。您使用什么技术来定位用户。WWDC视频和Core Location programming Guide(核心位置编程指南)提供了有关如何减少电池影响的建议,特别是降低所需的准确性、增加更新前的距离以及使用重要位置更改服务
    - (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{
    NSLog(@"Location Current : %@ ",userLocation.location);
    [self.mapView setCenterCoordinate:userLocation.location.coordinate animated:YES];
}