Getting Longitude/Latitude of the User When the viewDidLoad
问题 My purpose is to get the longitude/latitude of the user when the view is loaded and to store the values in two variables for later calculations. I don't need to track the user location and to update it, I simply need to get his/her coordinates once . My code looks like this: - (void)viewDidLoad { [super viewDidLoad]; // locationManager update as location locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy =