iOS下载多个图像并更新UIProgressView时出现一些问题 [英] iOS some problems during download multiple images and update UIProgressView
问题描述
我有这3个课程。
- MyViewController.m (click to see code)
- MySync.m (click to see code)
- ImageDownload.m (click to see code)
当我下载图片时,我尝试更新UIViewController中的UIProgressView,但更新被延迟,我看到一个奇怪的问题(见附件图片中的空格)。
When I download a image, I try to update the UIProgressView in my UIViewController, but the update are delayed, and I see a strange problem (see the blank space in attach image).
当所有下载完成并执行MyCompleteController的syncComplete ,方法dismissAlertView不被触发:S
When all downloads are complete and execute the method "syncComplete" of "MyViewController", the method "dismissAlertView" is not triggered :S
我希望有人可以帮助我。
I hope somebody can help me.
谢谢。 b $ b
推荐答案
假设t帽子syncComplete是一个调用dismissAlertView,确保iI正在调用UI线程(主线程)。如果您使用GCD,则会出现以下情况:
Assuming that syncComplete is the one calling dismissAlertView, make sure iI is calling to the UI thread (main thread). Something like this if you use GCD:
dispatch_async (dispatch_get_main_queue (), ^{
// call the dismissAlertView method here
});
这篇关于iOS下载多个图像并更新UIProgressView时出现一些问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!