开发者

Location icon not disappearing

开发者 https://www.devze.com 2023-03-03 14:36 出处:网络
I have a map view in my application which - among other things - displays the location of the user. Therefore my application will show the location arrow on the status bar but when I go to another vie

I have a map view in my application which - among other things - displays the location of the user. Therefore my application will show the location arrow on the status bar but when I go to another view of the application the arrow does not disappear.

Therefore it seems that the application is still location the user - which should not be the case as the user is no longer on the view. Could I have forgot to "release" the user's location and if so, how will I do that?

//
// SET MAPVIEW
//

MKCoordinateRegion region = { {0.0, 0.0 }, { 0.0, 0.0 } };
region.center.latitude = 56.989808;
region.center.longitude = 9.656177;
region.span.longitudeDelta = 0.007f;
region.span.latitudeDelta = 0.003f;

[mapView setShows开发者_如何学CUserLocation:TRUE];
[mapView setMapType:MKMapTypeHybrid];
[mapView setRegion:region animated:FALSE];


When you done with your location work then call -

[locationManager stopUpdatingLocation];

here locationManager is the instance of CLLocationManager.

0

精彩评论

暂无评论...
验证码 换一张
取 消