Search code examples
iphoneasynchronousthree20image-caching

TTImageView shows black image (OR: replacement for TTImageView)


I'm using Three20's TTImageView for it's async image loading + caching.

I've noticed this issue a bunch of times where an image will show up as completely black, and never finish loading. Here's an example of what I'm seeing:

http://screencast.com/t/7O7fnedX5Z2

So...basically I'm wondering if this is a bug in three20, and if so, how I might go about fixing it (is there a patch out there that might fix it)...OR:

Is there a good TTImageView replacement that performs async image loading + caching?


Solution

  • Turns out I was seeing the following in my log:

    TTRequestLoader connection:didReceiveResponse:: TTDASSERT failed: 0 == _queue.maxContentLength || contentLength <=_queue\ .maxContentLength

    (one for each failed image)

    After that, a little bit of googling rendered:

    http://groups.google.com/group/three20/browse_thread/thread/8bfac3654a6d9674/caf797f265445971?pli=1

    Jeff Verkoeyen:

    The comment immediately before that assert should shed some light on the situation.

      // If you hit this assertion it's because a massive file is about to be downloaded. 
      // If you're sure you want to do this, add the following line to your app delegate startup 
      // method. Setting the max content length to zero allows anything to go through. If you just 
      // want to raise the limit, set it to any positive byte size. 
      // [[TTURLRequestQueue mainQueue] setMaxContentLength:0]