You may get help from below two links:
LINK-1:
http://iphonedevsdk.com/forum/iphone-sdk-development/2299-cllocationmanager-stopupdatinglocation-not-working.html
Refer to site_reg's answer in above link:
I was having the same problem, and it seems to be fixed by declaring a static BOOL in your .m file and checking it when you enter the didUpdateToLocation method.
@implementation MyFile
@synthesize MySynth;
static BOOL haveAlreadyReceivedCoordinates = NO;
Then in your didUpdateToLocation method:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
if(haveAlreadyReceivedCoordinates) {
return;
}
haveAlreadyReceivedCoordinates = YES;
...
}
This won't technically make it stop receiving updates, but it will ignore any updates after the first one. If your app depends on getting just one location update to do its work, this should help.
EDIT-1:
Also once this is done, you can add locationManager.delegate = nil;
after [locationManager stopUpdatingLocation];
line.
LINK-2:
why self.locationManager stopUpdatingLocation doesn't stop location update
Refer to jnic's answer in above link:
The opposite of startMonitoringSignificantLocationChanges
is not
stopUpdatingLocation
, it is
stopMonitoringSignificantLocationChanges
.
You probably want to replace
startMonitoringSignificantLocationChanges
with
startUpdatingLocation
for the sake of more regular updates, unless
you have a specific reason for monitoring only for significant
location changes.
Check out the CLLocation
documentation
for further detail.
I have added the answers from the link just to make sure that answer is useful even if the provided links goes down in future.