最近项目中用到了百度地图定位 发现IOS8+的真机测试并无办法定位 应该是百度本身的问题测试
1. 在info.plist中加入如下两个属性:
NSLocationAlwaysUsageDescription=YES
NSLocationWhenInUseUsageDescription=YESspa
2. 在调用百度地图定位以前,加上以下代码:code
1 if ([[UIDevice currentDevice].systemVersion floatValue] >= 8) { 2 3 CLLocationManager *locationManager = [[CLLocationManager alloc] init]; 4 5 [locationManager requestAlwaysAuthorization]; 6 [locationManager requestWhenInUseAuthorization]; 7 8 }