2011-09-21 65 views
2

我正在使用SDWebImage将图像加载到我的表格单元格中 - 但是,直到我选择了该行,当我看到图像显示为图像时在屏幕上动画。当我从导航控制器上点击后,图像就在那里。使用SDWebImage将图像加载到UITableView单元时出现的问题

这可能只是网络速度问题还是我错过了什么?这是正在只是在一瞬间在模拟器上运行,如果有差别

代码:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
static NSString *simpleTableIdentifier = @"SimpleTableIdentifier"; 

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; 
if(cell == nil) 
{ 
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier] autorelease]; 
} 

// Configure the cell... 

NSUInteger row = [indexPath row]; 

// Here we use the new provided setImageWithURL: method to load the web image 
[cell.imageView setImageWithURL:[NSURL URLWithString:@"http://mydomain.com/uploads/news1.png"] placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; 

cell.textLabel.text = [listData objectAtIndex:row]; 

return cell; 

}

感谢

+0

可能可能已经修复它 - 占位符图像文件名是一个错字,它似乎现在工作。如果可以的话,我会将它标记为已回答。 – Dave

回答

3

固定的,它是不是正确的占位符图像。对不起浪费人们的时间...

+0

你可以展示代码或解释更多你解决它吗?我有同样的问题 – benLIVE

+0

对不起,这是我在我的老雇主做的一个项目 - 我不再有代码,我没有碰到ObjC,因为...从我写的这里我认为这是从结尾的第3行在那里我有图像的名称或我使用的路径不正确。 – Dave

相关问题