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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:15:59+00:00 2026-06-04T14:15:59+00:00

I`m trying to return the user location in MKMapKit, but at LOG, it returns

  • 0

I`m trying to return the user location in MKMapKit, but at LOG, it returns always 0.0000, 0.0000. when the project run, it shows the userLocation at map.. but at log show 0, 0..

some body know how to do it? take a look in my code:

- (void)viewDidLoad

{
[super viewDidLoad];

//esconder navBar
[[self navigationController] setNavigationBarHidden:YES animated:NO];

mapView.showsUserLocation = YES;


double lat = -21.21258;
double lng = -47.816802;

CLLocationCoordinate2D Coordinate;

NSLog(@"%f , %f", mapView.userLocation.coordinate.longitude, mapView.userLocation.coordinate.latitude);

Coordinate.latitude = lat;
Coordinate.longitude = lng;

MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init];
annotationPoint.coordinate = Coordinate;
annotationPoint.title = @"Ribeirão Shopping";
annotationPoint.subtitle = @"Ribeirão Preto - SP";
[self.mapView addAnnotation:annotationPoint]; 

MKCoordinateRegion newRegion;
newRegion.center.latitude = lat;
newRegion.center.longitude = lng;
[self.mapView setRegion:newRegion animated:YES];

mapView.mapType = MKMapTypeStandard;

}

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-04T14:16:00+00:00Added an answer on June 4, 2026 at 2:16 pm

    finding user location for mapview does takes some time so give it some time before using mapView.userlocaiton git it a few seconds ~3 and then try to log the user location. I’m sure you will get it there.

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

Sidebar

Related Questions

Im trying to redirect to another page when user hits return.But its not working:
Im trying to return the value that a $ajax call returns, from a function
I'm trying to return a random number from a method but apparently the implicit
What I'm trying to do is return a mailbox location for a select few
I am trying to upload text files to a specified location, but the file
I am trying to write a method to return the current location. While I'm
Im trying out the Google Maps API Geocoding feature.The map loads fine, but im
I'm trying to search for a user's location, my problem is that I want
I'm trying to have a php script run when the user navigates away from
I am trying to obtain the address for the user location of a MKMapView

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.