2013-03-05 53 views
0

這是我的代碼,我創建了一個cusom UITableViewCell並使用SDWebImage異步加載圖像。但它不起作用。當我使用像這樣的「cell.imageView setImage ...」的默認單元格,它工作正常,我不知道爲什麼?iOS SDWebImage for UITableView?

DiscoutCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; 
[cell.goodsImageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zanwutupian.png"]]; 
+1

你能讓我們知道你是如何初始化cellForRowAtIndexPath:方法中的單元嗎?如果你使用「xib」,你應該從bundle中加載xib。 – Anupdas 2013-03-05 01:59:22

+0

if(!nibsRegistered)UINib * nib = [UINib nibWithNibName:@「DiscoutCell」bundle:nil]; [tableView registerNib:nib forCellReuseIdentifier:cellIdentifier]; nibsRegistered = YES; } – Jackie 2013-03-05 02:12:49

+0

我也有一些標籤要顯示在單元格中,並沒有問題。唯一的問題是圖像 – Jackie 2013-03-05 02:13:47

回答

0

解決 我發現我不認爲ImageView的鏈接到我的IBOutet ImageView的,我是在浪費你的時間很抱歉,這是我fault.I'm這麼不小心!無論如何,非常感謝!

+0

你應該感謝給予upvote :) – Anupdas 2013-03-05 04:02:08

+0

哈哈,對不起,我是新來的:) – Jackie 2013-03-05 04:37:17