不同时显示 MKPinAnnotationView

Posted

技术标签:

【中文标题】不同时显示 MKPinAnnotationView【英文标题】:show MKPinAnnotationView not simultaneously 【发布时间】:2014-01-30 06:20:46 【问题描述】:

您好,我想根据存储在数组中的纬度和经度值显示MKPinAnnotationView,但我希望所有引脚不应同时出现。应该是一个接一个,意思是当一个pin在一段时间后出现另一个pin出现

提前致谢

【问题讨论】:

使用 NSTimer 来实现这一点 【参考方案1】:

使用NSTimer 来完成它: 像这样:

-(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;
    

【讨论】:

以上是关于不同时显示 MKPinAnnotationView的主要内容,如果未能解决你的问题,请参考以下文章