iPhone SDK,通过第2个线程向mapview添加注解,需要刷新mapview
我正在编写一个 iPhone 应用程序,需要根据用户选择的“加油站”、“餐厅”等组来显示注释。我正在使用 MBProgressHUD,每次用户单击某个选项时,第二个线程都会在后台添加注释。问题是,在我移动地图之前,新注释不会显示在屏幕上。无论如何,在我从另一个线程添加新注释后,是否可以“刷新”或“唤醒”mapView 以立即显示新注释?谢谢
Im writing an iphone app that needs to display annotations depending on groups like "Petrol Stations","Restaurant" as user selects. I'm using MBProgressHUD and adding annotations is done in background by a 2nd thread everytime user clicks on a choice. The problem is the new annotations aren't displayed on the screen until I move the map around. Is there anyway to kind of "refresh" or "wake" the mapView to display new annotations immediately after I add them from another thread ? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:
您可以创建一个方法,在您调用的后台计算坐标后将注释添加到mapView。
Edit:
You can create a method that adds the annotations to the mapView after you calculated the coordinates in the background you call.