Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 目标c:如何从定位服务中找到航向(方向)?_Iphone_Objective C_Ios_Cllocationmanager - Fatal编程技术网

Iphone 目标c:如何从定位服务中找到航向(方向)?

Iphone 目标c:如何从定位服务中找到航向(方向)?,iphone,objective-c,ios,cllocationmanager,Iphone,Objective C,Ios,Cllocationmanager,我正在做定位服务,希望从定位服务中获得方向,我有所有想要的属性,例如纬度、经度等,但我也想找到方向(方向) 我从CLHeading中找到了一些线索,但仍然无法从CLHeading中获取。我正在使用上面的代码读取:) 我想你应该用trueHeading 真航向 相对于正北的航向(以度为单位)。(只读) @属性(只读,非原子)CLLocationDirection TrueTHeading i、 e.使用-(void)headingUpdate:(CLHeading*)heading{NSLog(@

我正在做定位服务,希望从定位服务中获得方向,我有所有想要的属性,例如纬度、经度等,但我也想找到方向(方向)

我从CLHeading中找到了一些线索,但仍然无法从CLHeading中获取。我正在使用上面的代码

读取:) 我想你应该用trueHeading

真航向

相对于正北的航向(以度为单位)。(只读) @属性(只读,非原子)CLLocationDirection TrueTHeading


i、 e.使用
-(void)headingUpdate:(CLHeading*)heading{NSLog(@“This heading%d”,[heading trueHeading]);}
但问题是headingUpdate未被激发。
 (void)locationUpdate:(CLLocation *)location {
    locationLable.text = [location description];
    CLLocationCoordinate2D coordinate = [location coordinate];
    NSLog(@"This is location   %@",[location description]);
    NSLog(@"Lattitude          =   %@",[NSString stringWithFormat:@"%f", coordinate.latitude]);
    NSLog(@"Langitude          =   %@",[NSString stringWithFormat:@"%f", coordinate.longitude]);
    NSLog(@"Altitude           =   %@",[NSString stringWithFormat:@"%gm", location.altitude]);
    NSLog(@"horizontalAccuracy =   %@",[NSString stringWithFormat:@"%gm", location.horizontalAccuracy]);
    NSLog(@"verticalAccuracy   =   %@",[NSString stringWithFormat:@"%gm", location.verticalAccuracy]);
    NSLog(@"Speed   =   %@",[NSString stringWithFormat:@"%gm", location.speed]);

}


- (void)headingUpdate:(CLHeading *)heading {
    NSLog(@"This is heading   %@",[heading description]);

}

- (void)viewDidLoad {
    locationController = [[MyCLController alloc] init];
    locationController.delegate = self;
    [locationController.locationManager startUpdatingLocation];
    [locationController.locationManager startUpdatingHeading];
}