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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:41:53+00:00 2026-05-20T23:41:53+00:00

I am struggling with geolocation on simulator, but recently, I have tested it directly

  • 0

I am struggling with geolocation on simulator, but recently, I have tested it directly on device (iPhone) but the same issue remains, here is what I got when my app finish launching and the code of geolocation suppose to give me my location on the map (remember the picture above is for my app on iPhone and not with the simulator) :

enter image description here

so for my code, my app actually have a lot of views, but concerning this function, I have worked on the appdelegate(.m and .h) and the view concerning of showing the location on the map (PositionActuelleViewController).

appdelegate.m :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    sleep(3);




    // Override point for customization after application launch.

    self.locationManager=[[[CLLocationManager alloc] init] autorelease];

    if([CLLocationManager locationServicesEnabled]) {
        self.locationManager.delegate=self;
        self.locationManager.distanceFilter=100;
        [self.locationManager startUpdatingLocation];

    }


        // Add the view controller's view to the window and display.
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];

    return YES;
}

and in the same file after the dealloc method :

     #pragma mark CLLocationManagerDelegate Methods


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

        MKCoordinateSpan span;
        span.latitudeDelta=0.2;
        span.longitudeDelta=0.2;


        MKCoordinateRegion region;
        region.span=span;
        region.center=newLocation.coordinate;
        [viewCont.mapView setRegion:region animated:YES];

        viewCont.mapView.showsUserLocation=YES;
        viewCont.latitude.text=[NSString stringWithFormat:@"%f",newLocation.coordinate.latitude];
        viewCont.longitude.text=[NSString stringWithFormat:@"%f",newLocation.coordinate.longitude];

}

my PositionActuelleViewController.m file :

#import "PositionActuelleViewController.h"
@implementation PositionActuelleViewController

@synthesize mapView;
@synthesize latitude;
@synthesize longitude;

-(IBAction)goBackToMenu {
    [self dismissModalViewControllerAnimated:YES];
}
-(IBAction)goToRechercherView;
{
    rechercherViewController.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;

    [self  presentModalViewController:rechercherViewController animated:YES];

}

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)dealloc {
    [mapView release];
    [latitude release];
    [longitude release];
    [super dealloc];
}
@end

What am I missing here?

  • 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-20T23:41:54+00:00Added an answer on May 20, 2026 at 11:41 pm

    Does the delegate method -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation ever get called? Maybe if you uncomment self.locationManager.distanceFilter=100; it will work because according to docs, distanceFilter property defines the minimum distance (measured in meters) a device must move laterally before an update event is generated.

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

Sidebar

Related Questions

I'm struggling to find the right terminology here, but if you have jQuery object...
been struggling with an issue now for a day or two. I have an
Im struggling here for a lot, Im trying to upload an image from iphone
Just struggling with a simple issue with ASP.NET MVC. I have a list of
Struggling here... I am trying to have views displayed during specific periods in a
Struggling with styling the mouse over for a button ... I have managed to
Iam struggling with NHibernate and its lazyload. I have a structure which I simplified
im struggling with syntax here: hopefully this question is v simple, im just miising
Attempting/struggling to get registration and sign-up working within an active admin project. I have
I'm struggling with this Looper in Android. I have a timer that runs every

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.