I'v been reading through the Apple Docs, read through a couple tutorials online, and even watched the CS193p lectures on iCloud however there is still one thing I'm not clear about:
Take the case where you have an application that syncs documents to iCloud. How do you allow the user to still view/edit existing documents and create new documents while he/she is not able to reach the iCloud service (airplane mode, network not available, etc...)
For example. The 'reminder's application in iOS5 allows the user to view/edit existing documents that reside on iCloud even though you may be in airplane mode. The changes are then propagated the next time the iCloud service is available.
This seems really strange to me. How do you populate a list of reminders if your metadata query isn't provided a valid URL to a ubiquitous container? ie., calling URLForUbiquityContainerIdentifier:
will return nil since iCloud is not available. Then creating a metadata query isn't possible because you can't provide it a URL to query on. Hence, you can't populate a list of documents for the user to view and edit offline.
Any help or insight to how this is done is greatly apprecaited!
====================================UPDATE====================================
Ok - I stumbled upon this thread: here
It's basically talking about how files are stored in the file system when using iCloud. From what I gather whenever a file is created on iCloud it's basically kept in a special extended local storage container that is created when you first call URLForUbiquityContainerIdentifier:
. This special directory is managed by the iCloud deamon. In addition to being stored in this special directory the document is also uploaded to the cloud for use by other applications.
Now - assuming my assumption above is correct, the question is: If iCloud suddenly is not available, how do you access the files stored by the local daemon?