CLLocationManager and degrees of heading in iPhone

cllocationmanager, degrees, iphone

Solution

For headings degrees you can use `magneticHeading` and `trueHeading` properties instead of `x` and `y`.

trueHeading

The heading (measured in degrees) relative to true North. (read-only)

@property(readonly, nonatomic) CLLocationDirection trueHeading

Discussion

The value in this property represents the heading that points toward the geographic North Pole. The value in this property is always reported relative to the top of the device, regardless of the device’s physical or interface orientation. The value 0 represents true North, 90 represents due East, 180 represents due South, and so on. A negative value indicates that the heading could not be determined.

Problem

Using the CLLocationManager object's didUpdateHeading event, how do I convert the resulting heading.x and heading.y values into degrees I can plot onto an image of a compass?

Original source