Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 iphone 中使用 GPS,它显示使用位置服务的确认消息。我想捕获用户选择“允许”或“否”。任何人都可以建议我如何做到这一点?
感谢
您不会从此警报中获得直接回调。但是,如果用户不允许使用核心位置,-locationManager:didFailWithError:您kCLErrorDenied的CLLocationManagerDelegate.
-locationManager:didFailWithError:
kCLErrorDenied
CLLocationManagerDelegate
从 iOS 4.2 开始,您还可以收听-locationManager:didChangeAuthorizationStatus:或查看authorizationStatus. CLLocationManager这为您提供了详细的状态。
-locationManager:didChangeAuthorizationStatus:
authorizationStatus
CLLocationManager