zoukankan      html  css  js  c++  java
  • iOS8

    并在Info.plist中加入两个缺省没有的字段

    • 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了,就会弹出原来的提示框

  • 相关阅读:
    理解事件驱动select,poll,epoll三种模型
    谈谈对线程与进程的理解
    5-3.首行缩进
    5-2.行高
    5-1.字间距
    4-6.字体样式重置
    4-5.字体风格
    4-4.字体粗细
    4-3.字体颜色设置
    4-2.字体设置
  • 原文地址:https://www.cnblogs.com/kexiaozhu/p/4444212.html
Copyright © 2011-2022 走看看