【发布时间】:2014-01-30 06:20:46
【问题描述】:
您好,我想根据存储在数组中的纬度和经度值显示MKPinAnnotationView,但我希望所有引脚不应同时出现。应该是一个接一个,意思是当一个pin在一段时间后出现另一个pin出现。
提前致谢
【问题讨论】:
-
使用 NSTimer 来实现这一点
标签: ios mapkit mkpinannotationview
您好,我想根据存储在数组中的纬度和经度值显示MKPinAnnotationView,但我希望所有引脚不应同时出现。应该是一个接一个,意思是当一个pin在一段时间后出现另一个pin出现。
提前致谢
【问题讨论】:
标签: ios mapkit mkpinannotationview
使用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;
}
}
【讨论】: