0

Our app has a rotating map view which aligns with the compass heading. We counter-rotate the annotations so that their callouts remain horizontal for reading. This works fine on iOS5 devices but is broken on iOS6 (problem seen with same binary as used on iOS5 device and with binary built with iOS6 SDK). The annotations initially rotate to the correct horizontal position and then a short time later revert to the un-corrected rotation. We cannot see any events that are causing this. This is the code snippet we are using in - (MKAnnotationView *)mapView:(MKMapView *)theMapView viewForAnnotation:(id )annotation

CATransform3D transformZ = CATransform3DIdentity;
transformZ = CATransform3DRotate(transformZ, _rotationZ, 0, 0, 1);
annotation.myView.layer.transform = transformZ;

Anyone else seen this and anyone got any suggestions on how to fix it on iOS6?

goelectric
  • 320
  • 3
  • 10

1 Answers1

3

I had an identical problem so my workaround may work for you. I've also submitted a bug to Apple on it. For me, every time the map got panned by the user the Annotations would get "unrotated".

In my code I set the rotations using CGAffineTransformMakeRotation and I don't set it in viewForAnnotation but whenever the users location get's updated. So that is a bit different than you.

My workaround was to add an additional minor rotation at the bottom of my viewForAnnotation method.

if(is6orMore) {
        [annView setTransform:CGAffineTransformMakeRotation(.001)]; //iOS6 BUG WORKAROUND !!!!!!!
 }

So for you, I'm not sure if that works, since you are rotating differently and doing it in viewForAnnotation. But give it a try.

Took me forever to find and I just happened across this fix.

Fraggle
  • 8,607
  • 7
  • 54
  • 86
  • Thanks Fraggle - that did the trick for my situation too - you are a hero. Can you share the Apple Bug id so I can track it too please? – goelectric Oct 08 '12 at 11:54