Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8671891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:03:52+00:00 2026-06-12T19:03:52+00:00

I initialize the locationManager this way: if (!self.locManager) { self.locManager = [[CLLocationManager alloc] init];

  • 0

I initialize the locationManager this way:

if (!self.locManager) 
{
    self.locManager = [[CLLocationManager alloc] init];
    self.locManager.delegate = self;
    [locManager startMonitoringSignificantLocationChanges];
}

my device is not moving and still “didUpdateToLocation” is being called every time.
What could be a problem?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:03:53+00:00Added an answer on June 12, 2026 at 7:03 pm

    didUpdateToLocation may update for a number of reasons, a good strategy for handling this is to gradually filter results based on timestamp, then required accuracy.

    Apple provide a good example in the LocateMe sample app:

    - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
    {
        // test the age of the location measurement to determine if the measurement is cached
        // in most cases you will not want to rely on cached measurements
        NSTimeInterval locationAge = -[newLocation.timestamp timeIntervalSinceNow];
        if (locationAge > 5.0) return;
    
        // test that the horizontal accuracy does not indicate an invalid measurement
        if (newLocation.horizontalAccuracy < 0) return;
    
        // test the measurement to see if it is more accurate than the previous measurement
        if (self.bestEffortAtLocation == nil || self.bestEffortAtLocation.horizontalAccuracy > newLocation.horizontalAccuracy)
        {
            // store the location as the "best effort"
            self.bestEffortAtLocation = newLocation;
    
            // test the measurement to see if it meets the desired accuracy
            //
            // IMPORTANT!!! kCLLocationAccuracyBest should not be used for comparison with location coordinate or altitidue 
            // accuracy because it is a negative value. Instead, compare against some predetermined "real" measure of 
            // acceptable accuracy, or depend on the timeout to stop updating. This sample depends on the timeout.
            //
            if (newLocation.horizontalAccuracy <= locationManager.desiredAccuracy) {
                // we have a measurement that meets our requirements, so we can stop updating the location
                // 
                // IMPORTANT!!! Minimize power usage by stopping the location manager as soon as possible.
                //
                [self stopUpdatingLocation:NSLocalizedString(@"Acquired Location", @"Acquired Location")];
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I initialize an array this way: array = Array.new array << '1' << '2'
I am using CLLocationManager on device and the delegate methods aren't getting called. Here's
//Initialize the detail view controller and display it. OrderDetailsView *dvController = [[OrderDetailsView alloc] initWithNibName:@OrderDetailsView
I want to initialize libraries in cluster by their names represented as strings. This
I initialize my placeholder like so: default.phtml (layout file) <?php $this->placeholder('hero')->captureStart(); ?> <div class=primary>
When initialize a new git repository (on Linux/Ubuntu), we use: # What this doing:
I am trying to initialize two NSArrays with the following code self.fillingTypes = [[NSArray
When I initialize this array inside my struct. I get the error message -
To initialize a class from my library I'm doing this: VALUE obj = rb_funcall(rb_path2class(MyGem::ClassName),
I initialize my AVAudioPlayer instance like: [self.audioPlayer initWithContentsOfURL:url error:&err]; url contains the path of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.