19.6. Managing the State of Documents in iCloud
You want to be able to detect conflicts and other issues that could occur as a result of syncing documents to iCloud.
Stat listening to the
I highly recommend reading Recipe 19.5 before proceeding with this recipe, as the material described here highly relies on what was taught in that section.
notification gets sent when the state of an iCloud document (of type
UIDocument) is changed. The object
carried by this notification is the instance of the
UIDocument whose state was changed. You can
listen to this notification and then analyze the
documentState property of your iCloud
document; this property is of type
UIDocumentState and can be a mixture of these
Things are normal and no conflicts have occurred in the document.
This means that the document has not yet been opened, or was open and has just been closed. You might want to disallow the user from editing the document while the document is in this state. Apple recommends that you do not display alert views to your users, but instead, perhaps, display graphical components on the screen to indicate to the user that editing has been disabled.
This state indicates that a conflict has happened in the document. For instance, the same document could had been edited by two or more people at the same time ...