Cocoa touch 如何告知用户对位置服务提示的回答?

Cocoa touch 如何告知用户对位置服务提示的回答?,cocoa-touch,ios4,geolocation,Cocoa Touch,Ios4,Geolocation,我正在使用ALAssetLibrary获取照片的原始创建日期。当我这样做时,会弹出位置服务提示,询问用户应用程序是否可以访问地理数据。我理解这样做的必要性(即使我没有使用geodata)。但是,我如何知道用户的响应?我需要能够保存响应,以便我的代码下次可以选择适当的路径。既然您正在谈论定位服务,您可以使用CLLocationManager中的方法 if ( [CLLocationManager authorizationStatus] != kCLAuthorizationStatusAutho

我正在使用ALAssetLibrary获取照片的原始创建日期。当我这样做时,会弹出位置服务提示,询问用户应用程序是否可以访问地理数据。我理解这样做的必要性(即使我没有使用geodata)。但是,我如何知道用户的响应?我需要能够保存响应,以便我的代码下次可以选择适当的路径。

既然您正在谈论定位服务,您可以使用
CLLocationManager
中的方法

if ( [CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) {
    // Your app is not authorized.
}

由于您正在谈论定位服务,因此可以使用
CLLocationManager
中的方法

if ( [CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) {
    // Your app is not authorized.
}