iPhone Mapkit:图钉一一掉落
我正在使用 mkmapview 并在其上放置图钉。我希望销钉一根一根地落下,而不是同时落下。最初我正在调用
[self performSelector:@selector(dropPin) withObject:nil afterDelay:dropTime];
其中 dropTime 是每个引脚的不同延迟,而 dropPin 是一种使引脚下降的方法。不幸的是,这背后的多线程似乎会导致崩溃。
有谁知道更好的方法吗?
I'm using an mkmapview and dropping pins on to it. I would like the pins to fall one by one, rather than all simultaneously. Originally I was calling
[self performSelector:@selector(dropPin) withObject:nil afterDelay:dropTime];
where dropTime was a different delay for each pin, and dropPin was a method to make the pin drop. Unfortunately the multithreading behind this seems to cause a crash.
Does anyone know a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的目标是 iOS4,块是处理动画的好方法,而无需担心委托、回调或选择器:
If you're targeting iOS4, blocks are a great way to handle animations without worrying about delegates, callbacks, or selectors: