Reputation: 622
I wanna add a compass to ARView in the following project: http://developer.apple.com/library/ios/#samplecode/pARk/Listings/pARk_ARView_m.html#//apple_ref/doc/uid/DTS40011083-pARk_ARView_m-DontLinkElementID_5
I used - (void) locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading
But it doesnt seem to be executed . Please Help me solve this. Thanks in advance
Upvotes: 2
Views: 396
Reputation: 437532
See the below quote from the Location Awareness Programming Guide. Also, you might want to check your location configuration (under "Privacy" in iOS 6) in the Settings
app to make sure your app is authorized for location operations.
According to the Guide:
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.
Upvotes: 2