iCloud : how to manage iCloud deactivation?

I'm facing a problem concerning the iCloud synchronization process.

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. This is done by the setUbiquitous method.

My problem arise if the user deactivates iCloud in the iPhone settings ( by switching off "iCloud documents and data save" ). In this case the iCloud directory is no more accessible and the app sandbox is void ( because it was deleted by the setUbiquitous method ). 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. 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. 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".

Need Your Help

How to show "No results found" in UITableView, if there is no search result returned?

ios objective-c swift uitableview uisearchcontroller

In a table view, i am showing "No results found" if no results returned by search controller by adding an else condition as below-

tracking loading times of 3rd party plugins in google analytics

javascript jquery google-analytics

I am using a 3rd party plugin service (POWr.io) to add elements to our online store built using Shopify. The plugin does not support script tags, so I was unable to add tags using the Google Tag M...