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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:21:04+00:00 2026-05-20T18:21:04+00:00

I am making one app on iphone sdk4.0.In that did update location method never

  • 0

I am making one app on iphone sdk4.0.In that did update location method never called.
I have given my code below.Please help.Thanks in advance.

-(id)init
{
    [super init];

    obj=[[UIApplication sharedApplication]delegate];

    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    //locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
    locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
    [locationManager startUpdatingLocation];

    return self;

}

-(void)locationManager:(CLLocationManager *)manager
   didUpdateToLocation:(CLLocation *)newLocation
          fromLocation:(CLLocation *)oldLocation
{
    NSLog(@"%f",newLocation.coordinate.latitude);

    NSLog(@"%f",newLocation.coordinate.longitude);

    obj=[[UIApplication sharedApplication]delegate];

    location=[[CLLocation alloc]initWithLatitude:newLocation.coordinate.latitude longitude:newLocation.coordinate.longitude];
    obj.lattitude1=[NSString stringWithFormat:@"%f",newLocation.coordinate.latitude];

    obj.longitude1=[NSString stringWithFormat:@"%f",newLocation.coordinate.longitude];
    //location=[[CLLocation alloc]initWithLatitude:39.9883 longitude:-75.262227];
}
  • 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-20T18:21:04+00:00Added an answer on May 20, 2026 at 6:21 pm

    HI, your codes seems ok.
    now these can be possible reasons :

    on your init: try to check if there is locationServicesEnabled or not.

    locationManager = [[CLLocationManager alloc] init];
    if(locationManager.locationServicesEnabled == NO){
        //Your location service is not enabled, Settings>Location Services  
    }
    

    other reason, you may disallow to get location to your app.
    solution: simply remove your application from iPhone and re-build, now it should popup dialog to Allow location.

    use this to check error

    - (void)locationManager:(CLLocationManager *)manager
           didFailWithError:(NSError *)error
    {       
        NSLog(@"Error while getting core location : %@",[error localizedFailureReason]);
        if ([error code] == kCLErrorDenied) {
            //you had denied 
        }
        [manager stopUpdatingLocation];
    }
    

    otherwise all seems ok,
    you were already running ios 4.0 , which can be install in iPhone 3G and later,
    if it was iPhone 2g, then this problem may occur.

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

Sidebar

Related Questions

I'm making an iPhone app that uses Core Plot at one point in the
So I'm making an iphone app that just has a thousand entries that I'm
i am making an iphone app that get data from web ,i use HPPLE
I'making website which is for all desktop/iPad/iPhone. In one page I have header and
I am making an iPhone app in which on one of the UIWebView I
Assuming I have implement that : making my app as a server which means
I'm currently making a whimsical iPhone app that will allow you to change your
I'm contemplating making an android version of my iPhone app. One of the attractions
I'm making an app that behaves something like the default Messages.app in iPhone where
I am making an iphone app, in one of the view I am trying

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.