GCD异步加载网络图片

    dispatch_queue_t network_queue;

    network_queue = dispatch_queue_create("com.myapp.network", nil);

    

    dispatch_async(network_queue, ^{

        UIImage *cellImage = [self loadMyImageFromNetwork:[self.content objectAtIndex:indexPath.row]];

        

        // 回到主线程

        

        dispatch_async(dispatch_get_main_queue(), ^{

            

            // 显示图片到界面

            cell.imageView.image = cellImage;

            [cell setNeedsLayout];

            

        });

    } );

 

另附:

使用UIImageView展现来自网络的图片

关键字:异步加载、图片缓存

http://blog.csdn.net/jasonblog/article/details/7352483

你可能感兴趣的:(异步加载)