任何人都可以帮我解决这个错误:
目的已弃用
我可以做些什么来完成这项工作?
- (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;
}
答案 0 :(得分:2)
iOS 6弃用了目的属性,现在必须在Info.plist
中设置密钥NSLocationUsageDescription
,该密钥在Xcode中显示为隐私 - 位置使用说明。如果您仍然支持iOS 5及更早版本,请确保同时包含这两者。