iPhone - CLHeading 寻找方向

标签 iphone direction

在我的 iPhone 应用程序中,我使用 CLLocationManager 来查找我的 iPhone 指向的方向。我正在使用“标题”属性。它给了我 x、y 和 z 值。 如何从这些值中找到我当前指向的方向(北或南或东或西)?

最佳答案

您应该使用方法[locationManager startUpdateHeading]来获取相对于地理北极或磁北极的角度。然后就可以得到里面的值了

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

关于iPhone - CLHeading 寻找方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4296035/

相关文章:

iphone - 启动网站并登录 iOS

iphone - 自定义 tableView 标题导致单元格边框显示

javascript - Google Directions Api JavaScript 将 API key 链接到 php 文件

algorithm - 垂直于 3D 点集合的方向?

inline - 垂直内联 block ?

iphone - 我怎么知道我的应用程序是否在 iTunes 应用程序商店中有推荐?

iphone - 强制 iPhone 模拟执行 CPU 密集型任务?

iphone - 构建成功但未在模拟器上运行

swift - 如何在谷歌地图(swift)中的两个标记之间绘制路线?

iphone - 在 iphone 中查找方向,例如 North 等