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 9177375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:18:44+00:00 2026-06-17T17:18:44+00:00

First off, I am very new to iOS Dev and Objective-C. So please excuse

  • 0

First off, I am very new to iOS Dev and Objective-C. So please excuse any stupid questions or code.

I have been testing the location services on an iPhone. I have this code that is fired off by a NSTimer:

- (void)startLocationTracking
{

  if(self.locationManager==nil){
    _locationManager=[[CLLocationManager alloc] init];

    _locationManager.delegate=self;

    _locationManager.desiredAccuracy=kCLLocationAccuracyBest;

    _locationManager.distanceFilter=1;

    self.locationManager=_locationManager;

  }

if([CLLocationManager locationServicesEnabled]){

    [self.locationManager startUpdatingLocation];

  }

}

And here is my location manager function:

-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation    *)newLocation fromLocation:(CLLocation *)oldLocation{

[self timerLog];

NSString *deviceID = [self getUUID];

double lat = newLocation.coordinate.latitude;
double lon = newLocation.coordinate.longitude;
double alt = newLocation.altitude;
double dir = newLocation.course;
double spd = newLocation.speed;
double ha = newLocation.horizontalAccuracy;
double va = newLocation.verticalAccuracy;

NSDateFormatter *formatter;
NSString        *ts;

formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];

ts = [formatter stringFromDate:[NSDate date]];   

[self geoTrackingWS :deviceID :lat :lon :alt :dir :spd :ha :va :ts];

[manager stopUpdatingLocation];

}

For some reason my function geoTrackingWS is firing off multiple times randomly. The NSTimer is running every 1 minute (just as a test) and sometimes it works fine and it calls the geoTrackingWS just once but other times it hits 2 or 3 times.

I have done logging and I can see my NSTimer is working fine and firing off as it should.

I have a feeling it has something to do with another application on my phone but I am not sure.

Any help or insight on this would be great.

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-17T17:18:46+00:00Added an answer on June 17, 2026 at 5:18 pm

    The location manager usually has multiple ways of determining your location, including:

    • cell tower triangulation;
    • wifi network identification;
    • GPS.

    The first of those is least accurate but easiest to get, the second is usually more accurate but takes a while longer to figure out (as there’s a network request for the lookup) and the final is most accurate but can take quite a while to figure out (searching for satellites, etc).

    As a result it is expected behaviour that the location manager will respond with increasingly accurate results the longer it’s left running. You can see the consequence of that when running Maps for example — it usually pins you down to quite a wide area quite quickly and then takes some time to get a more accurate estimate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I am very new to Objective C and iPhone programming. Now that
Ok first off I have to say I'm very new to Rails. I have
First of all, let me say I am very new to rails, have been
I have this weirdest problem. First off: I'm VERY new to this certificate thingy.
First off, I've been given a very tight deadline (read: measured in minutes) to
I am trying to create a very basic sprite image. First off i have
first off I'm very new to rails - I'm playing about with a little
Okay, first off I am very, very new to java. For this project I
First off, I'm very new to PHP (and programming in general) and I'm trying
First off, sorry the code is kinda messy. It didn't format very well. My

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.