我想在以下项目中向 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:
- Create a
CLLocationManager
object.- Determine whether heading events are available by calling the
headingAvailable
class method. (In iOS 3.x and earlier, check the value of theheadingAvailable
property instead.)- Assign a
delegate
to the location manager object.- If you want true north values, start location services.
- Call the
startUpdatingHeading
method to begin the delivery of heading events.
关于objective-c - ios:向 ARView 添加指南针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13392903/