在iOS中存储图像的最佳方式 [英] Best way to store images in iOS

查看:141
本文介绍了在iOS中存储图像的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人可以建议我为我的应用程序存储图像的最佳方式。

I was wondering if anyone could suggest the best way for me to store images for my app.

我希望能够提供XML更新功能,允许用户使用一组新图像更新其应用。我想知道最好的方法是什么,因为我需要读取和写入商店位置。是以最好的方式将它们存储在sqlite数据库中,还是我能够使用文件系统来执行此操作,而iPhone无法删除任何下载的图像?

I want to be able to provide an XML update functionality that will allow the user to update their app with a new set of images. I was wondering what the best way to do this was as i need to read and write to the store location. Is storing them in a sqlite database the best way or am i able to use the filesystem to do this without the chance of the iPhone deleting any of the downloaded images?

谢谢

推荐答案

您可以写入文件系统,iOS中的每个应用程序都是沙箱,并且可以访问自己的文档文件夹。

You can write to the filesystem, every app in iOS is sandboxed and has access to his own documents folder.

我建议在文件系统上编写,只保存数据库中的URL,因为这比在数据库中保存blob更有效。

I would suggest to write on filesystem and only save the urls on the database as that is more performant than saving blobs on a database.

Apple对 iOS文件系统。

这篇关于在iOS中存储图像的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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