首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不同时显示MKPinAnnotationView

不同时显示MKPinAnnotationView
EN

Stack Overflow用户
提问于 2014-01-30 06:20:46
回答 1查看 39关注 0票数 0

嗨,我想根据存储在数组中的纬度和经度的值来显示MKPinAnnotationView,但是我希望所有的引脚不应该同时出现。它应该是一个接一个,意思是,当一个引脚出现在某个延迟之后,另一个引脚出现

提前感谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-01-30 06:35:25

使用NSTimer来完成它:如下所示:

代码语言:javascript
复制
-(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;
    }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21449237

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档