views:

53

answers:

1

Hi,

To move custom annotations in my MKMapView class, I remove all annotations first and add them (which are placed in new locations) again every second. It was perfectly working on iOS 3 but when I updated my OS and XCode to version 4.0, the annotations blink instead of smooth movement they used to have in previous version.

Any suggestion is appreciated.

A: 

This is probably a bad workaround and more effort than needed, but it should work:

  1. Get a UIImage by rendering the old MKMapView to a bitmap: http://stackoverflow.com/questions/788662/rendering-uiview-with-its-children-iphone-sdk
  2. Display that UIImage over your map view.
  3. Change your annotations (user doesn't see the blink because the image is covering the map view)
  4. Once the blink is done, quickly fade the image out. Not a perfect transition, but better than nothing.
igul222
This could be a good solution depends on the application. Unfortunately, in mine, user should be able to pan/zoom the map while the objects are moving. So the above solution may cause serious performance concerns.
Pooya
Actually I try to develop a location-based game in which user can gather some coins, escape from moving monsters,....
Pooya