简体   繁体   English

iOS:iCloud备份核心数据库?

[英]iOS: Backup core data database in iCloud?

I did some research but all I could find was syncing data core with iCloud. 我做了一些研究,但我发现只是将数据核心与iCloud同步。 I need to know if it is possible / recommended to backup a core data in iCloud. 我需要知道是否可以/建议在iCloud中备份核心数据。 I have an app which uses data core to store information. 我有一个使用数据核心来存储信息的应用程序。 I would like to have some kind of backup implemented for whenever the user decides to reformat his phone..get a new phone..etc. 我希望在用户决定重新格式化他的手机时实现某种备份......一个新的手机......等等。 Is iCloud the way to go ? iCloud是否可行? We already implemented export to CSV and we're planning to implement import from CSV. 我们已经实现了对CSV的导出,我们计划从CSV实施导入。 I was just wondering if iCloud was a solution for backing up core data once a day lets say..or smth like that. 我只是想知道iCloud是否是每天一次备​​份核心数据的解决方案让我们这么说。或者像这样。 Thank you ! 谢谢 !

That's what iCloud is for. 这就是iCloud的用途。 You can implement it, then when the user moves to a new device, all the data is there for them. 您可以实现它,然后当用户移动到新设备时,所有数据都在那里。 It's not really a backup solution though, in the way you're thinking about it, the user doesn't really have access to a file they can copy to a USB stick. 它并不是一个真正的备份解决方案,但正如你所想的那样,用户实际上无法访问他们可以复制到USB记忆棒的文件。 It's a way to have the data available to all devices and to move the data to new devices. 这是一种将数据提供给所有设备并将数据移动到新设备的方法。 It doesn't backup once a day, it backs up at more regular intervals. 它不会每天备份一次,而是以更加规律的间隔进行备份。 It works well with Core Data too, loading the updates asynchronously, only sending delta updates through the network, syncing quickly over WiFi. 它也适用于Core Data,异步加载更新,仅通过网络发送增量更新,通过WiFi快速同步。 Check out the WWDC 2011 session 303 video or Using Core Data with iCloud Release Notes and iCloud Storage Guidelines . 查看WWDC 2011会话303视频或使用核心数据与iCloud发行说明iCloud存储指南

I don't think it's that easy to implement iCloud with Core Data, they're both complicated to learn, but it will probably save you trouble in the future to use them. 我认为使用Core Data实现iCloud并不容易,但它们的学习起来很复杂,但它可能会让您在将来使用它们时遇到麻烦。

I am new to iCloud as well but as far as I understood it a pure backup should be possible: 我也是iCloud的新手,但据我所知,纯备份应该是可能的:

There are different possibilities but at the bottom your core data implementation will most likely use a SQLite file to store its data. 有不同的可能性,但在底部,您的核心数据实现很可能使用SQLite文件来存储其数据。 To create a backup of this file simply copy it to a location inside the iCloud directory (the directory specified by the URL you get from URLForUbiquityContainerIdentifier. 要创建此文件的备份,只需将其复制到iCloud目录内的位置(由URLForUbiquityContainerIdentifier获取的URL指定的目录)。

As pointed out before I am new to that topic too. 正如我之前所指出的那样,我也是那个话题的新手。 Thus there is a good chance that I am talking nonsense. 因此,我很有可能说废话。 But if I am not, it might be what you are look your and be worth a try. 但如果我不是,那可能就是你的样子,值得一试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM