2
votes

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

1

1 Answers

2
votes

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:

  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.