开发者

Loading Images issue in UITableViewCell

I get image开发者_JS百科s from a URL using XML Parsing. I loaded the all images from url in to UITableViewCell using Parsing. But when I press the scrollbar in UITableView, it make slowly to loading images.

I used the following code.

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];

How can I increase the loading speed?


Take a look at Apple's LazyTableImages example.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜