ios本机应用程序允许保存来自网络的数据吗?
我们正在构建一个包含数百张图像(大小近 300mb)的 iPad 照片库。拥有网络应用程序将是一个缺点,因为用户每次都必须下载图像(因为我猜 ipad 上的 Safari 不会缓存它们?)
因此,如果我们构建一个本机 ios 应用程序,是否可以下载来自网络的新图像并在将来将其添加到应用程序中?
非常感谢您的帮助!
We're building an iPad photo gallery with hundreds of images (almost 300mb in size). Having a web app will be a disadvantage because users will have to download the images every time (since Safari on ipad won't cache them I'm guessing?)
So if we built a native ios app instead, would it be possible to download newer images from the web and add it to the app in the future?
Thanks a ton for your help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
每个 iPhone 应用程序都有自己的主目录,其中包含 Library 和 Documents 文件夹,以及用于存储临时文件的 tmp 目录。
查看部分标题:应用程序运行时环境。
我会将您的图像保存到 Application Home/Library/Caches 文件夹中。
摘自 Apple 文档:
使用此目录编写您希望在应用程序启动之间或应用程序更新期间保留的任何特定于应用程序的支持文件。您的应用程序通常负责添加和删除这些文件。它还应该能够根据需要重新创建这些文件,因为 iTunes 在设备完全恢复期间会删除它们。
在 iOS 2.2 及更高版本中,iTunes 不备份此目录的内容。
Each iPhone application has its own home directory containing Library and Documents folders, and a tmp directory for storing temporary files.
Take a look at section title: A Few Important Application Directories on The Application Runtime Environment.
I would save the your images to Application Home/Library/Caches folder.
Excerpt from Apple Docs:
Use this directory to write any application-specific support files that you want to persist between launches of the application or during application updates. Your application is generally responsible for adding and removing these files. It should also be able to re-create these files as needed because iTunes removes them during a full restoration of the device.
In iOS 2.2 and later, the contents of this directory are not backed up by iTunes.
http:// iosdevelopertips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html
您可以在第一次查看时下载它,在 uiimage 上显示,然后保存它如上所述
http://iosdevelopertips.com/data-file-management/save-uiimage-object-as-a-png-or-jpeg-file.html
you could download it on first view, display at the uiimage, then save it off as above