0

Can anyone help me solve this error:

purpose is deprecated

What can I do to make this work?

- (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;
}
Mat
  • 202,337
  • 40
  • 393
  • 406

1 Answers1

2

in case if you are not able to find it on google

iOS 6 deprecated the purpose property and it now has to be set in your Info.plist with the key NSLocationUsageDescription which is displayed in Xcode as Privacy - Location Usage Description. If you're still supporting iOS 5 and earlier make sure you include both.

Pawan Rai
  • 3,434
  • 4
  • 32
  • 42