- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray<CLLocation *> *)locations {
[manager stopUpdatingLocation];
// 将代理对象置为空,防止多次调用
manager.delegate = nil;
CLLocation *lastLocation = [locations lastObject];
}
定位成功之后,将代理对象置为空,如果没有委托引用:代理对象无法find您的didUpdateLocations方法
******开始定位时,将manager的代理对象重置