如何陷阱位置警报响应iphone

Mit*_*tri 3 iphone gps core-location cllocationmanager ios

我在iphone中使用GPS,它显示使用位置服务的确认消息.我想捕获用户选择"允许"或"否"的内容.谁能建议我怎么做?

谢谢

Ort*_*ntz 8

您无法从此警报中获得直接回调.但是,如果用户不允许核心位置的使用,您会收到-locationManager:didFailWithError:一个kCLErrorDenied错误的CLLocationManagerDelegate.

由于iOS 4.2的,你还可以听-locationManager:didChangeAuthorizationStatus:或检查authorizationStatusCLLocationManager.这为您提供了详细的状态.