objective-c - ios:向 ARView 添加指南针

标签 objective-c ios orientation augmented-reality compass-geolocation

我想在以下项目中向 ARView 添加指南针:http://developer.apple.com/library/ios/#samplecode/pARk/Listings/pARk_ARView_m.html#//apple_ref/doc/uid/DTS40011083-pARk_ARView_m-DontLinkElementID_5

我使用了- (void) locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading

但是好像没有执行。 请帮我解决这个问题。 提前致谢

最佳答案

请参阅以下引述 Location Awareness Programming Guide 。此外,您可能需要在设置应用中检查您的位置配置(在 iOS 6 中位于“隐私”下),以确保您的应用已获得位置操作授权。

根据指南:

The steps for receiving heading events are as follows:

  1. Create a CLLocationManager object.
  2. Determine whether heading events are available by calling the headingAvailable class method. (In iOS 3.x and earlier, check the value of the headingAvailable property instead.)
  3. Assign a delegate to the location manager object.
  4. If you want true north values, start location services.
  5. Call the startUpdatingHeading method to begin the delivery of heading events.

关于objective-c - ios:向 ARView 添加指南针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13392903/

相关文章:

objective-c - AFNetworking 下载多个文件内存占用

ios - 检查 AVFoundation 的资源何时可用

ruby - 将方向(N、S、SE、SSE 等)转换为方位角

Android:防止屏幕方向改变但仍会收到通知

android - 将陀螺仪与加速度计相结合以获得航向

objective-c - arc4random 非模偏差?

ios - 在ios后台重复运行代码

ios - UIView 动画曲线减速使用 UIViewAnimationOptionCurveEaseOut

ios - 使用 moya 和 alamofire 时参数编码的发布请求错误

ios - XCTest Swift - 如何更快或更精确地滑动?