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

  • Home
  • SEARCH
  • 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 8732107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:22:40+00:00 2026-06-13T09:22:40+00:00

I cannot get my current location in iphone simulator. I set custom location to

  • 0

I cannot get my current location in iphone simulator. I set custom location to latitude and longitude to Egypt but doesn’t get current location.

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    //Make this controller the delegate for the map view.
    self.MapView.delegate = self;     

    // Ensure that you can view your own location in the map view.
    [self.MapView setShowsUserLocation:YES];



    //Instantiate a location object.
    locationManager = [[CLLocationManager alloc] init];
    [locationManager startUpdatingLocation];

    //Make this controller the delegate for the location manager.
    [locationManager setDelegate:self];

    //Set some parameters for the location object.
    [locationManager setDistanceFilter:kCLDistanceFilterNone];
    [locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
}

and this is delegate :

#pragma mark - MKMapViewDelegate methods.

- (void)mapView:(MKMapView *)mv didAddAnnotationViews:(NSArray *)views 
{    
    MKCoordinateRegion region;
    region = MKCoordinateRegionMakeWithDistance(locationManager.location.coordinate,2000,2000);


    [mv setRegion:region animated:YES];
}

Please any one help me.

  • 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-13T09:22:41+00:00Added an answer on June 13, 2026 at 9:22 am

    What’s the problem exactly? Not getting a userLocation where you’re supposed to have or not moving the map region to the right place?

    If it’s the first, it is mostly a tools issue, not a code issue:

    If your location is in a gpx file inside your project you should be able to start at it by editing Scheme / Options / Allow Location Simulation / and choose your default Location

    Scheme Edition for starting at a specific place

    And you should have a DemoStart.gpx file in your project that looks like:

    <?xml version="1.0"?>
    <gpx version="1.1" creator="Xcode">
        <wpt lat="20.88072" lon="10.67429">
            <name>Demo Starting Location</name>
        </wpt>
    </gpx>
    

    (Sorry, I’m too lazy to find Egypt’s exact coordinates).

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

Sidebar

Related Questions

I cannot get the DropDownHeight of the ComboBox set properly to display all the
I am trying to get the name of the city of user's current location
This is my code to get current location using Geolocation property of HTML5, <!DOCTYPE
i've a piece of code that should get the current location and than put
i cannot get current content page html. when i trying access from script in
I want to search the current location in my app, but I see entire
I am trying to get the user's current location on multiple controller, they are
All- I am trying to get the user's current location than display that on
I want to get the Zip-Code for current user location from Windows Phone 7.
I cannot get my Wordpress theme to randomise the posts I'm displaying in the

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.