zoukankan      html  css  js  c++  java
  • ios简单实现如果没有开启定位,提示开启系统软件定位功能

    if([CLLocationManager locationServicesEnabled] && [CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {//判断该软件是否开启定位

            JJLog(@"没打开");

            self.isAddress = YES;

            UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"打开定位开关" message:@"请点击设置打开定位服务" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"设置", nil];

            [alertView show];

        }else{

            JJLog(@"打开");

        }

    - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{

      if (buttonIndex == 1) {

              NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

              if ([[UIApplication sharedApplication] canOpenURL:url]) {

                  [[UIApplication sharedApplication] openURL:url];

              }

          }

    }

  • 相关阅读:
    DBSCAN密度聚类
    特征工程之特征预处理
    特征工程之特征表达
    特征工程之特征选择
    Adaboost,GBDT和XGboost算法
    036 Go操作NSQ
    035 Go操作Redis
    034 Go操作MySQL
    033 protobuf初识
    032 二进制协议gob及msgpack介绍
  • 原文地址:https://www.cnblogs.com/sunfuyou/p/6182863.html
Copyright © 2011-2022 走看看