如何陷阱位置警报响应iphone [英] how to trap the location alert response iphone

查看:100
本文介绍了如何陷阱位置警报响应iphone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPhone上使用GPS,并显示使用位置服务的相符消息。我想捕捉用户选择允许或否。
可以任何一个建议我如何做到这一点?

谢谢

解决方案

您无法从此警报中直接回拨。但是,如果用户不允许使用核心位置,则会收到 -locationManager:didFailWithError:,其中 kCLErrorDenied error to your CLLocationManagerDelegate



从iOS 4.2开始,您还可以收听 - locationManager:didChangeAuthorizationStatus:或者检查 CLLocationManager authorizationStatus 。这给你一个详细的状态。


I am using GPS in iphone and it show conformation message for use location service. and i want to trap what user select "Allow" or "No". can any one suggest how i do this?

Thank

解决方案

You don't get a direct callback from this alert. However, if the user does not allow Core Location usage, you'll receive a -locationManager:didFailWithError: with a kCLErrorDenied error to your CLLocationManagerDelegate.

Since iOS 4.2, you can also listen to -locationManager:didChangeAuthorizationStatus: or check the authorizationStatus of CLLocationManager. This gives you a detailed status.

这篇关于如何陷阱位置警报响应iphone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆