替代CCLocationManager的已弃用用途字段

时间:2014-05-29 08:20:49

标签: ios objective-c

任何人都可以帮我解决这个错误:

  

目的已弃用

我可以做些什么来完成这项工作?

- (CLLocationManager *)locationManager {

  if (_locationManager != nil) {
    return _locationManager;
  }

  _locationManager = [[CLLocationManager alloc] init];
  _locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
  _locationManager.delegate = self;
  _locationManager.purpose = @"Your current location is used to demonstrate PFGeoPoint and Geo Queries.";

  return _locationManager;
}

1 个答案:

答案 0 :(得分:2)

如果您无法在Google上找到

,请

iOS 6弃用了目的属性,现在必须在Info.plist中设置密钥NSLocationUsageDescription,该密钥在Xcode中显示为隐私 - 位置使用说明。如果您仍然支持iOS 5及更早版本,请确保同时包含这两者。