In iOS 6, the purpose property of CLLocationManager, to describe the reason for using location services (@property(copy, nonatomic) NSString *purpose) has been deprecated.
What replacement, if any, is proposed by Apple?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The replacement for the
purposeproperty in iOS 6 is a new Info.plist key namedNSLocationUsageDescription(aka “Privacy – Location Usage Description”).The key is documented in the Information Property List Key Reference but unfortunately it’s not mentioned with the deprecation note of the
purposeproperty.However, the
CLLocationManager.hdoes have this comment:In your code, you could set both the key and the
purposeproperty (but you may want to check if the location manager responds to that selector first if/when that method is actually removed in the future).If running under iOS 6, the location manager will use the key.
When running under less than iOS 6, the key will be ignored and the
purposeproperty will be used.