I'm completely stumped with a problem using CoreLocation.
I've checked out some other questions and on Google but can't seem to find anyone with this particular problem I'm having.
I am utilizing CoreLocation in my App and when I call [manager startUpdatingLocation]
then the little blue arrow on the status bar appears and the service begins and all is well.
In the app I have a UITabBarController, now only the first Tab makes use of CoreLocation so in my first Tab ViewController's viewDidDisappear
method, I call [manager stopUpdatingLocation]
Now here is where things go wrong, If I manually just tap the different tabs then the little blue arrow disappears and re-appears as I go back and forth between the tabs as I would expect them to.
However, upon doing something on the first tab, it will automatically switch to another tab via [self.tabBarController setSelectedIndex:1]
, when this happens, the blue arrow on the status bar does NOT disappear, and even if I continuously go back and forth through the tabs, that arrow is now basically stuck there for as long as the app is active (It does disappear if the app goes into the background though, but will re-appear on any tab and stay stuck there as before if it becomes active again).
Now I thought, maybe changing the tabs programatically doesn't call viewDidDisappear
, so I put a breakpoint there, but it does indeed get called.
Then I thought... Ok maybe if I call [manager stopUpdatingLocation]
just before i call [self.tabBarController setSelectedIndex:1]
that would fix the problem, but that didn't do anything either.
Now I'm lost for ideas and any help would be greatly appreciated.
P.S: I have tested to see if the CoreLocation delegate methods are still being called, and they don't seem to be called anymore unless the initial tab is open, so it does seem as though CoreLocation has stopped. However, from a user perspective this wouldn't seem to be the case.
EDIT: Seems like this might be a problem with some third party libraries, so isn't really something that can be answered