从 iPhone 应用程序导入/恢复备份的 SQLite
我正在使用 Core Data 开发我的第一个 iPhone 应用程序。目前困惑如何恢复以前备份的sqlite 文件。
我已经成功通过电子邮件导出 sqlite 文件。但不知道如何实现导入/恢复功能。基本上,这就是我希望在用户单击“导入数据”时完成的任务
- 显示用户可以通过任何计算机访问的视图列表 URL(保持应用程序运行)
- 当用户访问 URL 时,会出现一个带有两个按钮的简单网页(浏览、上传)出现
2a.用户可以从本地计算机浏览并获取 sqlite 文件并点击上传 - 当应用程序完成接收文件后,
3a.运行将 NSData 转换为 sqlite 的逻辑并将其保存在文档文件夹中
3b.通知用户导入已完成 - 最后应用程序已恢复数据。
我一直在浏览文章,但无法找到任何有用的信息。
任何指示将不胜感激。谢谢。
I am working on developing my first iPhone app using Core Data. Currently puzzled with how to restore previously backed up sqlite file.
I have been successful in exporting the sqlite file via email. But can't figure out how to implement the import/restore feature. Basically this is what I wish to accomplish as user clicks on "Import Data"
- Display a view listing URL that user can access via any computer (keeping the app running)
- When user accesses the URL, a simple web page with two buttons (Browse, Upload) appears
2a. User can browse and get the sqlite file from local machine and hit upload - As app is done receiving the file,
3a. Runs logic of converting NSData to sqlite and saves it in documents folder
3b. Informs user that import is complete - Finally app has the restored data..
I have been looking around through articles but am unable to find any helpful information.
Any pointers would be greatly appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会这样做。
I would do it this way.