通过在论坛中搜索,找到解决办法,我只是论坛的搬运工。分享如下:
1.在info.plist中加入:
NSLocationAlwaysUsageDescription=YES
NSLocationWhenInUseUsageDescription=YES
2.在调用百度SDK定位之前,先运行如下代码:
if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) {
//由于IOS8中定位的授权机制改变 需要进行手动授权
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
//获取授权认证
[locationManager requestAlwaysAuthorization];
[locationManager requestWhenInUseAuthorization];
}
|
转载于:https://www.cnblogs.com/frounk/p/4633213.html