【发布时间】:2011-03-04 23:22:09
【问题描述】:
我有一个关于解析 XML 并将其放入表格的问题。我从 RSS 提要中解析了以下元素:title、dc:creator 和 附件网址(= 一张图片)。
解析工作正常,我可以看到控制台中显示的所有内容。但是当我尝试将所有内容加载到表格单元中时,除了图像之外的所有内容都会显示出来。所以我认为问题一定出在 RootViewController.m(或 TableCell.m)中的 CellForRowatIndexPath 方法中
我做错了什么?请帮忙!我已经为此苦苦挣扎了好几天,但似乎无法弄清楚!
这是 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;
}
【问题讨论】:
标签: iphone uitableview rss uiimageview nsxmlparser