Abstract may be the best option. Define an annotation class with an assignable coordinate property (or use MKPointAnnotation).
, MKGeodesicPolyline , , , points ( MKMapPoint s) getCoordinates:range: ( ).
(, MKMultiPoint, MKPolyline MKGeodesicPolyline MKPolyline.)
coordinate , .
. .
, points ( , getCoordinates:range:) performSelector:withObject:afterDelay::
MKGeodesicPolyline *geodesic;
MKPointAnnotation *thePlane;
int planePositionIndex;
thePlane = [[MKPointAnnotation alloc] init];
thePlane.coordinate = sanFrancisco;
thePlane.title = @"Plane";
[mapView addAnnotation:thePlane];
planePositionIndex = 0;
[self performSelector:@selector(updatePlanePosition) withObject:nil afterDelay:0.5];
-(void)updatePlanePosition
{
planePositionIndex = planePositionIndex + 50;
if (planePositionIndex >= geodesic.pointCount)
{
return;
}
MKMapPoint nextMapPoint = geodesic.points[planePositionIndex];
CLLocationCoordinate2D nextCoord = MKCoordinateForMapPoint(nextMapPoint);
thePlane.coordinate = nextCoord;
[self performSelector:@selector(updatePlanePosition) withObject:nil afterDelay:0.5];
}