Iphone:XML图像问题
问题描述:
我有一个解析XML并将其放入表的问题。我解析从RSS提要以下元素:标题,DC:创作者和外壳URL(=的图像)。Iphone:XML图像问题
解析工作,我可以看到在控制台中显示的一切。但是当我尝试将所有内容加载到表格中时,除了图像以外,所有内容都会显示出来。所以我想这个问题必须在RootViewController.m中的CellForRowatIndexPath方法中(或者在TableCell.m中)
我在做什么错?请帮忙!我一直在为这个日子苦苦挣扎,而且似乎无法想象它!
继承人的的cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
WerkTableCell *cell = (WerkTableCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"WerkCell" owner:self options:nil];
cell =self.werkCell;
}
// Configure the cell.
NSMutableArray *cont= [xmlcont items];// is niet in tablevb v. PS
ItemData *current =[cont objectAtIndex:indexPath.row];
cell.titelLabel.text = [current titel];
cell.makerLabel.text = [current maker];
cell.thumbImage.image = [UIImage imageNamed:[current image]];
return cell;
}
答
imageNamed:
只会加载本地文件。很有可能,你的URL指向一个远程文件,你必须从Web服务器上获取它,然后才能将它加载到表中。