CCLocationManager popup
I have a locate me button in my app. The behaviour when user taps the button is quite strait forward. If location services is switched off I show an alert view to user about it otherwise starts updating location.
To check that locations services is enabled/disabled I start CLLocationManager
and if I get the error code kCLErrorDenied
in
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error
I show the UIAlertView that the location ser开发者_JS百科vice is disabled.
It works good but the problem happens when I start CLLocationManager
for the first time (or user resets his locations services settings). In this situation system shows alert which asks user if he's ok that app will use location services and if user does not allow to use location services I immediately get error in
- (void)locationManager:(CLLocationManager *)manager
didFailWithError:(NSError *)error
and should show second app's alert that locations services are disabled for the app but it's not really smart because user disabled it just second ago.
So the question is how to find out that system location services alert was on screen and user disabled location services second ago to not show second alert?
精彩评论