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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:46:18+00:00 2026-05-25T14:46:18+00:00

I am making my app using coreLocation. Below is my class and it send

  • 0

I am making my app using coreLocation. Below is my class and it send location updates to delegate class which receives location coordinates and use them.

Problem is when i start my app first time i go to home view(the class which use location coordinates is uiTableView and second one i.e next to home view ) it does not call didUpdateToLocation which is good because the view is not yet loaded.

Then when its view loads it gets called twice it should get called once. then again when i process my app n go to home view and press central button of iPhone, the app goes to background and then again when i start it on home view locationDidUpload method gets called 4 times though view is not yet loaded in which it is implemented. I dont want this because it makes system busy. Please suggest.

- (id)init {


self = [super init];

if(self != nil) {
    self.locMgr = [[[CLLocationManager alloc] init] autorelease]; // Create new instance of locMgr
    self.locMgr.delegate = self; // Set the delegate as self.
    self.locMgr.desiredAccuracy=kCLLocationAccuracyThreeKilometers;//check
    self.locMgr.distanceFilter=500;//check in meters
   [self.locMgr startUpdatingLocation];
        }

return self;
}


- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {  // Check if the class assigning itself as the delegate conforms to our protocol.  If not, the message will go nowhere.  Not good.
    NSLog(@"core");
    [self.delegate locationUpdate:newLocation];

}
}



- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
if([self.delegate conformsToProtocol:@protocol(CoreLocationControllerDelegate)]) {  // Check if the class assigning itself as the delegate conforms to our protocol.  If not, the message will go nowhere.  Not good.
   if (error.code==kCLErrorDenied) {
        UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Permission Denied" message:@"Please allow location to retrieve location" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil   , nil];
        [alert show];
        [alert release];


        [locMgr stopUpdatingLocation];
        [locMgr release];

        locMgr=nil;
    }

    [self.delegate locationError:error];
}
}

- (void)dealloc {
[self.locMgr release];
[super dealloc];
}

@end
  • 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-05-25T14:46:18+00:00Added an answer on May 25, 2026 at 2:46 pm

    You might try sending the message startMonitoringSignificantLocationChanges to your CLLocationManager instead of startUpdatingLocation?

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

Sidebar

Related Questions

We recently built a web app using Prototype, making a fair amount of use
I'm making an app which has a tableview and a DetailViewController. I'm using Apple's
Hi I'm making an app using GTKMM. The screenshot is below: Screenshot The Problem
I making a web app in Flex using global coordinates I get the coordinates
I'm making an App using Adobe Flex/Air. I was wondering if there is any
I am using CoreData with iPhone SDK. I am making a notes app. I
I am making a little GUI frontend for a app at the moment using
Im making a portion of my app using the netbeans gui editor. Great so
I'm making a rails 3.1 app using carrierwave to upload files to aws s3.
I'm making an accelerometer-based app using cocos2d, and I noticed that it's possible to

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.