iPhone - CLHeading to find direction

前端 未结 2 1288
清歌不尽
清歌不尽 2021-01-15 05:51

In my iPhone application, I\'m using using CLLocationManager to find the direction in which my iphone is pointing to. I\'m using the property \"heading\". Its giving me x,y

2条回答
  •  借酒劲吻你
    2021-01-15 06:24

    you should use method [locationManager startUpdateHeading] to enable get the angle relative to the geographic North Pole or magnetic North Pole. Then you can get the value in

     - (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading 
    {
       NSLog(@"%f",newHeading.trueHeading);
    }
    

提交回复
热议问题