Domanda

Hi I want to show MKPinAnnotationView based on the value of latitude and longitude stored in an array, but I want that all pins should not appear simultaneously. It should be one after another, means when one pin appears after some delay another pin appear.

Thanks in advance

È stato utile?

Soluzione

Use the NSTimer to get it done : Something like this :

-(Void)viewDidLoad{
       _timer = [NSTimer scheduledTimerWithTimeInterval:1.0f
                                                  target:self
                                                selector:@selector(_timerFired)
                                                userInfo:nil
                                                 repeats:YES];
}
- (void)_timerFired
{
   //Code to add the Annotation
   // Completed the annotation, then nil the Timer 
    if (_timer != nil && <annotationArray_reached_end>)
    {
      [_timer invalidate];
      _timer = nil;
    }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top