tags:

views:

144

answers:

1

Hello All,

How to get the Direction from Compass Calibration, i used core location framework and don't know how to get north direction from the function:

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading;

if anybody knows help me to get the solution.

+1  A: 

Hi, the method is the right. You can chosse between magnetic and true heading.

- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading{
    float compassHeading_True = newHeading.trueHeading;
    float compassHeading_Magnetic = newHeading.magneticHeading;
}

If you want allow compass calibration, you have to implement this method:

- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager{
return YES;}