An error occurred while locating iOS8.
Time: 2014-10-10
Today, during development, I found an iOS8 locating problem. After the operation is executed, the delegate method after positioning will not be called, then I checked the app positioning permission interface on my mobile phone and found that the permission for accessing the user's geographical location of my app was empty. Then I checked the relevant information, the following solutions are available:
1. In Appdelegate:
CLLocationManager * locationManager;
[UIApplication sharedApplication]. idleTimerDisabled = TRUE; locationmanager = [[CLLocationManager alloc] init]; [locationmanager requestAlwaysAuthorization]; // NSLocationAlwaysUsageDescription [locationmanager allocation]; // NSLocationWhenInUseDescription locationmanager. delegate = self;
2. Add the following to info. plist:
NSLocationWhenInUseDescription, which allows you to obtain the GPS description on the foreground
NSLocationAlwaysUsageDescription, which allows you to obtain the GPS description in the background.
For example:
After adding the above content, you can perform the positioning service. Baidu map and AMAP are also such problems.
Recommended articles: http://blog.csdn.net/yongyinmg/article/details/39521523