Question

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

Was it helpful?

Solution

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;
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top