views:

73

answers:

1

I have used startMonitoringSignificantLocationChanges method to locate current location. Its working fine if the device is stationary but it is not responding while travelling and cell towers changed.

It gets initial callback. I am using this method

-(void)UpdateOwnLocation{

[locationManager stopMonitoringSignificantLocationChanges];
[locationManager startMonitoringSignificantLocationChanges];

}

It is called after every regular intervals but not updating location while travelling. I tried to replace the method by-

-(void)UpdateOwnLocation{

//[locationManager stopMonitoringSignificantLocationChanges];
//[locationManager startMonitoringSignificantLocationChanges];

    [locationManager stopUpdatingLocation];
[locationManager startUpdatingLocation];  
      
}

and the process is executing in the background.

A: 

It works if the device is stationary? Do you mean you get the initial callback, but no subsequent callbacks?

Something you should be aware of:

There is a bug in CoreLocation in 4.1. Basically if your app is in the background, then it will crash when core location tries to wake you up. Apparently it is fixed in 4.2.

Cannonade