CoreLocation的总体知识观望

CLLoacationManger调用下面方法

  • CLLocationManager *locationManager = [[CLLocationManager alloc]init];

  • 1.[locationManager startUpdatingLocation];监听区域地理位置location(需要权限的设置)
    调用下面的方法:

    -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
    
  • 2.[locationManger startUpdatingHeading];监听方向(不需要权限设置)
    调用下面的方法:

     //获取到用户的方向时会被调用
    -(void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
    
  • 3 [locationManager startMonitoringForRegion:circular];区域的监听(需要设置权限)

    //进入一个区域(会调用)
    -(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
     //离开区域时调用
    -(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region)

你可能感兴趣的:(CoreLocation的总体知识观望)