Search code examples
objective-ccllocationmanagercllocation

Is there a way to set so that CLLocation do not update too often?


Obviously I need to update accurately. However not more often than once every 1 minute I think.


Solution

  • See example use of CLLocationManager and a handler class to do what you are asking. Rather than a timer, it sets up a handler to respond to location events received, checks the accuracy and time passed since previous event, then sends out a notification based on your requirements.

    The frequency of your response action is configurable as often as you require.

    It works in the background, with battery saving configuration options.

    See the code here TTLocationHandler

    You may also benefit from some of the discussion in this question thread Invoke get current coordinates every few seconds without NSTimer