• IOS GPS 定位


    1、添加引用Corelocation.framkwork

    2、  .h文件添加   #import <CoreLocation/CoreLocation.h>

    @interface ViewController : UIViewController
    {
        CLLocationManager *locationManger;
       
    }

    3.m文件添加

        locationManger =[[CLLocationManager alloc]init];
        [locationManger setDelegate:self];
       
        [locationManger setDistanceFilter:kCLDistanceFilterNone];
        [locationManger setDesiredAccuracy:kCLLocationAccuracyBest];
        [locationManger startUpdatingLocation];

    -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
    {
        NSLog(@"location:%@",newLocation);
       
    }

    -(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
    {
        NSLog(@"error:%@",error);
    }

  • 相关阅读:
    php1
    c# out参数
    c#冒泡算法
    c#方法 最大值我最小值
    方法
    OUT参数
    芮年
    PHP博客
    数组习题
    从郑和下西洋 到华人爱燕窝
  • 原文地址:https://www.cnblogs.com/zhibin/p/2724249.html
Copyright © 2020-2023  润新知