标签:
最近项目中用到了百度地图定位 发现IOS8+的真机测试并没有办法定位 应该是百度自己的问题
1. 在info.plist中加入以下两个属性:
NSLocationAlwaysUsageDescription=YES
NSLocationWhenInUseUsageDescription=YES
2. 在调用百度地图定位之前,加上如下代码:
1 if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) { 2 3 CLLocationManager *locationManager = [[CLLocationManager alloc] init]; 4 5 [locationManager requestAlwaysAuthorization]; 6 [locationManager requestWhenInUseAuthorization]; 7 8 }
标签:
原文地址:http://www.cnblogs.com/zhangzhuopeng/p/4595983.html