Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

18. iCloud Basics > Metadata Queries and the Cloud

Metadata Queries and the Cloud

Two new metadata scopes, NSMetadataQueryUbiquitousDataScope and NSMetadataQueryUbiquitousDocumentsScope, point to the iCloud’s Data and Documents folders. You can add an ongoing query to monitor these folders, creating a callback whenever the folder contents change. This allows you to know when new items appear or disappear and update your file listings accordingly. Listing 18-1 offers a pair of methods that demonstrate how to use this technology to query and monitor the folder:

• The first method, startMonitoringUbiquitousDocumentsFolder, sets up a monitor for the Documents folder scope, listening for update notifications. When these occur, the method uses an informal delegate callback to update a client.

• The second method, stopMonitoringUbiquitousDocumentsFolder, cancels the notification observation, allowing your code to stop any ongoing monitoring.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial