I have a class which contains an instance of MKMapView
@property(nonatomic, weak) IBOutlet MKMapView *ibMapView;
While I do also use a singleton instance of CLLocationManager
in other places in the project, I've found that this map view is responsible for the "Location" icon showing on the iPhone status bar.
Specifically, this code is to blame:
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// If I comment out this line below, the "Location" status icon never shows, as expected
self.ibMapView.showsUserLocation = YES;
// ...other magical stuff happens here, not related to map view
}
I've tried setting showsUserLocation
to NO like this
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.ibMapView.showsUserLocation = NO;
// I also have tried logging to make sure showUserLocation is set to NO- returns "NO" as expected
DebugLog(@"Show User Location: %@", self.ibMapView.showsUserLocation ? @"YES" : @"NO");
// ...other stuff happens here, not related to map view...
}
However, the location status icon still shows... it never turns off, even after an hour has passed...
How can I get the location status icon caused by setting showUserLocation
to YES on an MKMapView
instance to go away?