为也具有离线模式的 iPad 应用程序收集数据的最佳方式
我的客户在 iPad 应用程序简介中指出,数据(即产品和图像)必须从在线来源获取并保存。但是,该应用程序还必须具有离线模式,该模式可以在互联网访问不可用时显示该应用程序之前在线时的相同数据(有点像离线阅读器)。解决这个问题的最佳方法是什么?非常感谢任何帮助。
My client states in an iPad app brief that the data (i.e. products and images) must be taken from an online source and saved. However, the app must also have an offline mode which shows this same data from when the app was previously online for times when internet access is not available (kind of like an offline reader). What would be the best way to tackle this? Any help greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当设备在线时下载数据,并使用任何看起来最合适的机制(SQLite、核心数据、属性列表、您自己的文件格式等)将其存储在本地。离线时使用此缓存数据,在线时也可使用,除非它已更改。创建一些可用于在线检测和下载更新(最好只是更改)的机制。
这不仅对您的用户离线时有很大帮助,而且对在线用户也有很大帮助。 iPad 的 3G 数据套餐通常是有限的,因此您越能避免重复下载图像等大型资源,对您的用户就越有利。
Download the data when the device is online and store it locally using whatever mechanism seems most appropriate (SQLite, Core Data, property lists, your own file format, etc.). Use this cached data when offline, and when online too unless it has changed. Create some mechanism that you can use to detect and download updates (preferably just the changes) when online.
This will be a big help for your users not just when they're offline, but online too. 3G data plans for the iPad are usually limited, so the better you can avoid repeat downloads of large resources like images, the better for your users.