【发布时间】:2011-08-17 10:40:28
【问题描述】:
我想查找到某个位置的距离以及设备相对于该位置的前进方向。我已经确定了距离,但不知道如何找到位置。
_theLocation = [[CLLocation alloc]initWithLatitude:-41.561004 longitude:173.849030];
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLLocationDistance meters = [newLocation distanceFromLocation:_theLocation] * 0.000621371192;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
{
NSString *str = [NSString stringWithFormat:@"Heading = %.f", newHeading.trueHeading];
}
是否可以从我们的位置找到前往_theLocation 的标题?
【问题讨论】:
标签: iphone objective-c cllocationmanager cllocation