The uitableview view gets slow while receiving images from server through Json
' - (UITableViewCell的*)的tableView:(UITableView的*)的tableView的cellForRowAtIndexPath:(NSIndexPath *)indexPath {的UIImage通過JSON負載中的UITableView慢
NSString* CellIdentifier = [NSString stringWithFormat:@"Cell%d",indexPath.row];
UITableViewCellFixed *cell = (UITableViewCellFixed *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCellFixed alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:CellIdentifier] autorelease];;
}
NSURL *url = [NSURL URLWithString:[dict objectForKey:@"allfeeds3"]];
NSData *data = [[NSData alloc] initWithContentsOfURL:url];
// cell.imageView.image = [UIImage imageWithData:data];
UIImage *tmpImage = [[UIImage alloc] initWithData:data];
cell.imageView.image = tmpImage;
}
這已經在這裏問SOOOOOOOO很多次......請你只可以發佈您的問題之前搜索。答案已經在這裏... – 2012-04-09 15:28:47
選中此項:[異步加載圖像](http://stackoverflow.com/questions/5840451/asynchronous-loading-of-images),[將圖像加載到UIImage中異步](http ://stackoverflow.com/questions/9786018/loading-an-image-into-uiimage-asynchronously) – Lucien 2012-04-09 15:31:01