开发者

startMonitoringSignificantLocationChanges method not responding

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];
[locationMan开发者_如何学JAVAager 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜