【发布时间】:2012-02-05 07:33:55
【问题描述】:
我需要一些帮助来解决这个问题..
我正在从 XML 中获取数据,其中一个元素是图像文件名“Icon1.png”,图像保存在我的本地资源中,目前我可以使用此代码加载 icon1.png
// retrieve an image
NSString *imageicon = [[NSBundle mainBundle]
pathForResource:@"icon2" ofType:@"png"];
UIImage *cellicon = [[UIImage alloc] initWithContentsOfFile:imageicon];
//set the image on the table cell
cell.imageView.image = cellicon;
但我想从 XML 元素加载图标文件名
<dimage>icon2.png</dimage>
如何将图像加载到我的单元格中? - 解决了
第 2 部分 - 选择的行转到 bclass 描述视图控制器,
-(void)viewDidLoad {
self.title = bclass.title;
[self.textView setText:bclass.description];
[self.destag setText:bclass.descimg];
}
目前“discing”只是显示图像名称(UItextView),但我想在 UIImageView 上显示图像。
感谢您的帮助。
赫尔南多。
【问题讨论】:
标签: iphone xml uitableview xml-parsing