When the compass changes, it will execute the function and you can change the direction.
You can use the function below.
- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading {
if (newHeading.headingAccuracy > 0) {
CGFloat heading = (1.0f * M_PI * newHeading.trueHeading) / 180.f;
myLocationAnnotationView.transform = CGAffineTransformMakeRotation(heading);}}
this image illustrates the situation: