Download images from the Internet to UIImageView inside UITableView

How do I upload images from my site to a UITableView? What is the best way to work? And how can you handle image rendering when reusing table cells?

And how can I transfer the image from the View table to the cell during the didSelect..Row method?

+3
source share
2 answers

The best way to do it is lazy loading. You should not upload an image that the user is not viewing. Sample code is available at the link below.

Lazy tableImages

, . , , rootview- . : nib

PS: xml,

+2

, ( , -?), 4. . , !

NSOperations ( apple docs ), NSMutableDictionary, URL-, png jpeg ( UIImage) . @synchronize() , .

, , . ( )

-(void)somememorywarning;
{
    @synchronized(gImageCacheDict)
    {
        [gImageCacheDict removeAllObjects];
    }
 }

​​.., didSelect..

0

Source: https://habr.com/ru/post/1796567/


All Articles