如何使用Three20在xcode中从网络服务器加载图像?
我正在尝试使用 Three20 制作一个图像库应用程序,我想要做的是将图像存储在网络服务器上并将它们存储在 NSMutalbeArray 中并在缩略图视图中显示它们。 我浏览过 Three20 照片库,但到处都是本地图像或在代码中传递所有图像的链接。虽然我的问题是图像会频繁添加到服务器,因此每次将图像添加到服务器时更新代码并发送应用程序更新并不是一个好主意。 看来我必须使用 for( ) 循环,但我不知道如何将图像存储在 NSMutableArray 中并在 for( ) 循环中使用它来获取所有可用图像。 请帮忙
I'm trying to make an Image Gallery App using Three20 and what I want to do is get images stored on a webserver and store them in a NSMutalbeArray and display them in thumbnail view.
I've gone through Three20 Photo Gallery tuts but everywhere its either local images or passing links of all images in code. while my problem is Images will be added frequently to the server so its not a good idea to update code and send app update everytime an image is added to the server.
it seems i'll have to use for( ) loop but i don't know how to store images in NSMutableArray and use it in for( ) loop to get all the available images.
please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不太了解 Three20,但我可以告诉你的是,你可以使用 ASIHTTPRequest 下载图像并将其存储在本地以便稍后显示。
请参阅此处的文档
I don't really know Three20 but what i can tell you is that you can use ASIHTTPRequest to download the images and store them locally to display them later.
See documentation here
您应该能够实现
协议并在定义方法时提供远程 URL。你试过这个吗?
You should be able to implement the
<TTPhoto>
protocol and provide remote URLs when you define themethod. Have you tried this?