2011-09-21 64 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

相關問題