WrappedDocument

WrappedDocument is a continuation of the same class in Placid. The major differences are in the handling of saving and opening because in Placid, the documents were stored only in iCloud. In Loon, documents can be stored either in iCloud or in the local sandbox.

Listing 15.17 shows the header file. It’s a bit more complex than files you’ve seen before; that complexity comes from its use of a protocol and the way in which that protocol is declared. Because this is common, it is worthwhile to look at the issue.

The protocol (WrappedDocumentDelegate) is used in the declaration of the delegate property at line 3 in Listing 15.17. In order to use it there, a forward declaration for the protocol is placed at line 17. The protocol itself ...

Get Learning iCloud Data Management: A Hands-On Guide to Structuring Data for iOS and OS X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.