Hello.
I'm trying to develop my first app, a map app that shows nearby grocery stores with pins. But I have one problem, I'm not able to get the "users" location when i press the "location" button.
I have only found tutorials with latitude and longitude, and I have changed them to my location, but when I'm another place and presses the location button, the old location appears.
Is there any way to get the location to "autoupdate"?
This is the code in my ViewController.m file
I'm trying to develop my first app, a map app that shows nearby grocery stores with pins. But I have one problem, I'm not able to get the "users" location when i press the "location" button.
I have only found tutorials with latitude and longitude, and I have changed them to my location, but when I'm another place and presses the location button, the old location appears.
Is there any way to get the location to "autoupdate"?
This is the code in my ViewController.m file
Code:
-(IBAction)getlocation {
mapView.showsUserLocation = YES;
MKCoordinateRegion region;
region.center.latitude = 61.232357;
region.center.longitude = 10.22526;
region.span.longitudeDelta = 0.01;
region.span.latitudeDelta = 0.01;
[mapView setRegion:region animated:YES];
Last edited by a moderator: