开发者

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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜