ICloud is about to meet the fans of broad fruit. I believe many fans have been waiting for this service for a long time. How does iCloud, one of the most important iOS 5 updates, serve users? The following describes the internal structure of iCloud.
The simplest form of iCloud is actually a specific folder, which is located in the/private/var/mobile/Library/Mobile Documents/directory of iOS devices. This directory stores all application data shared by applications to the cloud.
The application has partial read/write permissions on the directory, which is unique to developers. For Password Key Strings, developers can share cloud data between applications. For example, all applications developed by Company X can share, view, and update the same file set. You cannot share data other than your developer account, so my application cannot see Company X files, and vice versa.
The iOS system monitors the Mobile Documents folder. When files are changed, the device automatically uploads these changes to the cloud. These changes can be transmitted to all devices bound to the same account. These operations are handled by the local operating system service, and applications are not directly involved.
Instead, applications subscribe to different types of notifications to let the application know the latest changes. Then, they can deal with data version conflicts by comparing local and iCloud data.
It's just what developers do. They can select the "recently modified valid" policy. Or they can combine some other changes. The role of an application is to ensure that data on different hardware device units is consistent and that available network connections are required to handle this consistency.
When a user loses the network connection, the problem arises. For example, you may edit the to-do list on a flight without a network connection, and your partner is updating the same to-do list in his or her city. Developers have been working for this for several months to study how to combine these changes and update the policy of the target file while accepting the changes made by both parties at the same time.
Finally, there may be few ways to use the iCloud API. It is actually a storage folder for remote synchronization. For developers, the trick is to consider the effect of time, space, and connection on folders because the folder must be adapted to user updates.