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(@"获取失败");

            }

            

        }];

        

        

    }

  • 相关阅读:
    批量重命令文件名称的几种方式
    SecureCRT常用快捷键
    ipv4地址从最后一位按步长递增
    win32
    GDI根据位图和透明度创建蒙版
    git bash的一些使用
    win32
    win32
    win32
    QT
  • 原文地址:https://www.cnblogs.com/guangleijia/p/4827419.html
Copyright © 2011-2022 走看看