从XML for iPhone App动态提取图像 [英] Dynamically pulling images from XML for iPhone App

查看:45
本文介绍了从XML for iPhone App动态提取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iPhone应用程序很好地通过XML提取了实时数据内容,并且我格式化了UITableView单元格以显示内容而没有太多麻烦.

I've got my iPhone app pulling down live data content via XML nicely, and I've formatted the UITableView cells to display the content without too many headaches.

但是,目前,我只为每个单元显示一个默认图形,但是我也希望将其从服务器中拉下.

However, at the moment, for each cell I'm just showing a default graphic for now, but I want this to be pulled down from my server too.

抓取图像(实际上在我的项目中)的代码段为:

The code snippet that grabs the image (which is actually in my project) is:

cell.imageView.image = [UIImage imageNamed:@"TBC.png"];

但这将是动态图像.

在我的XML中,最好还是返回"mypic.png",然后让SDK确定完整路径,例如 http://myapp.com/mypic.png 还是将图像的完整URL存储在XML中?

In my XML, am I better just returning 'mypic.png' and let the SDK determine the full path, like http://myapp.com/mypic.png or storing the full URL to the image in the XML?

推荐答案

如果应用程序将图像存储在本地,而XML仅告诉应用程序要使用的图像,则仅使用文件名.

If the app is storing the image locally and the XML just tells the app what image to use, then use just the file name.

这篇关于从XML for iPhone App动态提取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆