Table View with Images, slow load and scroll

前端 未结 4 985
死守一世寂寞
死守一世寂寞 2020-12-12 06:55

I tried impletmenting about 30 tutorials today and just cant get anything to work.

My problem is that i load my information via a JSON file, add the data to a NSMuta

4条回答
  •  无人及你
    2020-12-12 07:10

    You should use asynchronous image retrieval provided by UIImageView categories found in AFNetworking or SDWebImage. These categories:

    • are incredibly easy to use (rather than using the UIImageView method setImage, instead use one of the categories' setImageWithURL methods);

    • provide asynchronous image retrieval;

    • cache the downloaded images with NSCache, to make sure you don't have to retrieve images that you just downloaded;

    • ensure that your UI cannot get backlogged downloading images for cells that have scrolled off screen; and

    • leverage operation queues to constrain the degree of concurrency (rather than using GCD global queues that can result in timeout failures).

提交回复
热议问题