在UITableViewCell中加载图像问题

时间:2010-11-11 15:07:12

标签: iphone

我使用XML Parsing从URL获取图像。我使用Parsing将所有图像从url加载到UITableViewCell。但是当我按下UITableView中的滚动条时,它会慢慢加载图像。

我使用了以下代码。

NSString *image1 =[images objectAtIndex:indexPath.row];
NSLog(@"Images  .....   = %@",image1);
NSData *mydata = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:[images objectAtIndex:indexPath.row]]];
UIImage *myimage = [[UIImage alloc] initWithData:mydata];
UIImageView *imageView = [ [ UIImageView alloc ] initWithImage: myimage ];
imageView.frame = CGRectMake(0.0f, 00.0f, 60.0f, 63.0f); 
[cell.contentView addSubview:imageView];

如何提高加载速度?

1 个答案:

答案 0 :(得分:2)

相关问题