這是我的代碼,我創建了一個cusom UITableViewCell並使用SDWebImage異步加載圖像。但它不起作用。當我使用像這樣的「cell.imageView setImage ...」的默認單元格,它工作正常,我不知道爲什麼?iOS SDWebImage for UITableView?
DiscoutCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
[cell.goodsImageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zanwutupian.png"]];
你能讓我們知道你是如何初始化cellForRowAtIndexPath:方法中的單元嗎?如果你使用「xib」,你應該從bundle中加載xib。 – Anupdas 2013-03-05 01:59:22
if(!nibsRegistered)UINib * nib = [UINib nibWithNibName:@「DiscoutCell」bundle:nil]; [tableView registerNib:nib forCellReuseIdentifier:cellIdentifier]; nibsRegistered = YES; } – Jackie 2013-03-05 02:12:49
我也有一些標籤要顯示在單元格中,並沒有問題。唯一的問題是圖像 – Jackie 2013-03-05 02:13:47