i have an iPhone project in xcode, i've put a mapview and with the next code i show the user's location:mapView.showsUserLocation=YES;
.
But i want that when the user opens the app the applications zooms with an animation automatically, i think that i need to put this code in the viewDidLoad method.
Finally i need to store the latitude into a variable, i tried to to that with the next code: float latitud = mapView.userLocation.coordinate.latitude;
but the latituded that this returned was not the correct one of my location, i think that i need to do this with the CLLocationManager but i don't know how to do that.
Pl开发者_开发技巧ease, help me.
Thanks a lot.
If you are checking this with simulator you won't get your location coordinate. Your xcode give apple head-quarters as the user location
mapView.showsUserLocation=YES;
will work only in device.
精彩评论