as I was trying to complete the challenge Reverse Geocoding, the text wasn’t added in the label.
I added some breakpoints to Xcode and saw that even though [locationManager stopUpdatingLocation] is executed and [locationManager startUpdatingLocation] is not executed again, it keeps getting updated locations and going through the didUpdateToLocation delegate.
I’ve been searching about it on the internet and lots of people are saying “stopUpdatingLocation doesn’t work” but can’t find out why.
Here’s some narrowed-down code:
It goes once through breakpoint 1, then 3, 2, 3, 2, 3, 2 and keeps going between 3 and 2
[locationManager startUpdatingLocation]; <<<<< BREAKPOINT 1
[locationManager stopUpdatingLocation]; <<<<<<< BREAKPOINT 2
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
NSLog(@"%@", newLocation); <<<<<<<<<<< BREAKPOINT 3