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]; }); } );
另附:
关键字:异步加载、图片缓存