zoukankan      html  css  js  c++  java
  • 定位

    https://github.com/intuit/LocationManager

    #import "ViewController.h"

    #import "INTULocationManager.h"

    /**

     *  ios 8以上 需要在plist中配置

      NSLocationWhenInUseUsageDescription 

      NSLocationAlwaysUsageDescription

     */

    @interface ViewController ()

    @end

    @implementation ViewController

    - (void)viewDidLoad {

        [super viewDidLoad];

        // 1. 创建管理者对象

        INTULocationManager *mgr = [INTULocationManager sharedInstance];

        

        // 2. 获取位置

        [mgr requestLocationWithDesiredAccuracy:INTULocationAccuracyCity timeout:10.0 block:^(CLLocation *currentLocation, INTULocationAccuracy achievedAccuracy, INTULocationStatus status){

            

            if (status == INTULocationStatusSuccess) {

                LogRed(@"获取位置成功%f -- %f",currentLocation.coordinate.longitude, currentLocation.coordinate.latitude);

            }else{

                LogGreen(@"获取失败");

            }

            

        }];

        

        

    }

  • 相关阅读:
    Mysql添加用户与授权
    php导出数据到csv
    mysql导入数据和导出数据
    null在mysql中的不同表现
    乌班图安装Lnmp环境
    php框架路由美化后提示No input file specified
    cookie删除失效问题
    MongoDb安装
    MongoDb简介
    位置索引介绍
  • 原文地址:https://www.cnblogs.com/guangleijia/p/4827419.html
Copyright © 2011-2022 走看看