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

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

提前致谢

【问题讨论】:

  • 使用 NSTimer 来实现这一点

标签: ios mapkit mkpinannotationview


【解决方案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;
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-15
    • 1970-01-01
    相关资源
    最近更新 更多