Disk Fetch in background? #20

bogardon opened this Issue Feb 21, 2012 · 4 comments


None yet

3 participants



Is there any plans to defer disk fetch into a background thread/queue? This would help scrolling performance tremendously.


Can't you do that using a dispatch_async in tableView:cellForRowAtIndexPath: ? It might work out.


I assume you mean call setImageURL inside a dispatch_async(dispatch_get_global_queue....) type thing.

if setImageURL fires a network request instead of a diskfetch, the image will never be downloaded.

However, if setImageURL does a disk fetch, AND you call setNeedsDisplay in imageViewDidLoad, this would work.

I was looking for a more built in solution, possibly with the ability to cancel a disk fetch? though that is not likely.

Also, using DISPATCH_QUEUE_PRIORITY_LOW is still pretty laggy for scrolling. Ideally, we would want to use DISPATCH_QUEUE_PRIORITY_BACKGROUND, but this constant is only available for iOS 5.0 ...


After looking into - [EGOImageView setImageURL:]I noticed that it does everything there inside, like setting the image for the imageView which should be done in the mainThread, so you must not call this method in another thread. You'll have to modify the code to support this. Perhaps you can create another method that does the async stuff inside of it, or you can add a flag to the setImageURL: that allows you to choose whether you want set the image a/synchronously.


I ran into this, and resolved it by serially loading images off the main thread (see my branch). scrolling while loading is then smooth and works well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment