简体   繁体   English

iCloud:如何管理iCloud停用?

[英]iCloud : how to manage iCloud deactivation?

I'm facing a problem concerning the iCloud synchronization process. 我正面临着有关iCloud同步过程的问题。

When a user decide to activate iCloud, the document stored locally in the app sandbox is moved to the local iCloud directory and then the file in the sandbox is deleted. 当用户决定激活iCloud时,将本地存储在应用程序沙箱中的文档移动到本地iCloud目录,然后删除沙箱中的文件。 This is done by the setUbiquitous method. 这是通过setUbiquitous方法完成的。

My problem arise if the user deactivates iCloud in the iPhone settings ( by switching off "iCloud documents and data save" ). 如果用户在iPhone设置中停用iCloud(通过关闭“iCloud文档和数据保存”),我的问题就出现了。 In this case the iCloud directory is no more accessible and the app sandbox is void ( because it was deleted by the setUbiquitous method ). 在这种情况下,iCloud目录不再可访问,并且应用程序沙箱无效(因为它已被setUbiquitous方法删除)。 Therefore, the user lost all it's data... 因此,用户丢失了所有数据......

One solution could be to always maintain a copy of the iCloud file in the app sandbox... but that seems quite a lot of work. 一种解决方案可能是始终在应用程序沙箱中维护iCloud文件的副本......但这看起来相当多。 There should be an easier way to do... Anyone has a better idea/solution ?? 应该有一个更简单的方法......任何人都有更好的想法/解决方案?

Thanks for reading ;) 谢谢阅读 ;)

The files are not actually deleted and will be re-downloaded when iCloud is enabled again. 这些文件实际上并未删除,并且会在再次启用iCloud时重新下载。 Couldn't you just show a message with that information? 难道你不能只显示包含该信息的消息吗? In a way, that's similar to removing an email account in the settings app. 在某种程度上,这类似于在设置应用中删除电子邮件帐户。 The user probably expects that his/her emails are then deleted from the device, but are still available "in the cloud". 用户可能希望他/她的电子邮件随后从设备中删除,但仍然可以“在云中”使用。

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

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