iOS8 - CoreLocation的变化
2015-04-21 14:15
246 查看
并在Info.plist中加入两个缺省没有的字段
NSLocationAlwaysUsageDescription
NSLocationWhenInUseUsageDescription
这两个字段没什么特别的意思,就是自定义提示用户授权使用地理定位功能时的提示语。
这是在调用代理
这样就Ok了,就会弹出原来的提示框
NSLocationAlwaysUsageDescription
NSLocationWhenInUseUsageDescription
这两个字段没什么特别的意思,就是自定义提示用户授权使用地理定位功能时的提示语。
CLLocationManager *locationManager = [[CLLocationManager alloc]init]; locationManager.delegate = self; [locationManager requestAlwaysAuthorization]; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = kCLDistanceFilterNone; [locationManager startUpdatingLocation];
这是在调用代理
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { switch (status) { case kCLAuthorizationStatusNotDetermined: if ([locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) { [locationManager requestWhenInUseAuthorization]; } break; default: break; }}
这样就Ok了,就会弹出原来的提示框
相关文章推荐
- ios8 - CoreLocation定位服务的变化
- 迎接iOS8 - CoreLocation的变化
- iOS8下,CoreLocation的变化
- 迎接iOS8 - CoreLocation的变化
- Core Location Manager Changes in iOS 8(iOS8获取不到地理位置)
- iOS CoreLocation框架第一章—— CLLocationManager的使用(包含iOS6,iOS8,iOS9各种变动)
- CoreLocation Authorization in iOS8+
- Core Location Manager在iOS8中的改变
- iOS CoreLocation使用(iOS8 回调不行的问题解决)
- Core Location Manager在IOS8中的改变
- iOS8之后CoreLocation定位的使用
- iOS8 Core Location (授权。。。室内定位。。。访问监控。。。)
- IOS8 UILocalNotification 和之前的变化
- iOS8下的开发变化
- CoreLocation IOS 定位详解
- 推送通知在iOS8中变化
- 微服务框架下的思维变化-OSS.Core基础思路
- iOS8 Core Image In Swift:自动改善图像以及内置滤镜的使用
- Core Location定位和MapKit视图使用
- IOS 定位初步(CoreLocation)