문제

i'm wondering if there is an upper limit on how many setImageWithUrl messages can be submitted at one time ?i'm trying to load 30 photos , 10 of them are downloaded successful but the others entered in the requestFailed when trying to debug the issue

any hints or clarification ? Thanks

도움이 되었습니까?

해결책

For those who would come here seeking the answer about maximum number of concurrent downloads in SDWebImage, I would like to add to the previous answer.

I would not recommend changing init of SDWebImageDownloader, as you might want to update the SDWebImage or, like me, adjust the number of concurrent downloads in different areas of your app.

//thumbnails.m
//Loading thumbnails. It is faster to load them concurrently
SDWebImageManager.sharedManager.imageDownloader.maxConcurrentDownloads = 10;
[yourImageView setImageWithURL:thumbURL];

//fullScreen.m
//Loading big images in full-screen view, 
SDWebImageManager *sharedManager = [SDWebImageManager sharedManager];
[sharedManager.imageDownloader setMaxConcurrentDownloads:1];
[sharedManager cancelAll]; //cancel all current queue 
[yourImageView setImageWithURL:URL];

다른 팁

Though your problem was due to incorrect urls as you mentioned, I am answering this for others who come in looking for the answer:

One can set the maximum concurrent download count in the latest release of SDWebImage framework by setting the variable, downloadQueue.maxConcurrentOperationCount in the init of SDWebImageDownloader. this would limit the maximum number of concurrent downloads for the 'downloadwithURL' call in the application. The framework would put any additional operations in the queue and execute them as the currently executing download completes.

I found a strange problem by setting this value. Based on the apple doc, this value should only effect the concurrent download image number, not the total download image number. However, if my case, if this value is set to be 2, I can only download 2 images, even I call the download function more than 2. This value seems to set the size of the downloadQueue size, rather than the currentOperation number. Anyone has the same problem??

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top