I\'ve read the Apple docs and Ray Wenderlich\'s tutorial. It seems that I\'m forced to use UIDocument so I read it up in the docs. I\'ve found that it\'s effective to use Do
You are not in any way forced to use UIDocument
. You can use iCloud via NSFileManager
and NSMetadataQuery
. The general approach is:
-[NSFileManager setUbiquitous:itemAtURL:destinationURL:error:]
to transfer the file to iCloud storage.NSMetadataQuery
or by polling URL resource values.NSMetadataQuery
to locate iCloud-resident files-[NSFileManager startDownloadingUbiquitousItemAtURL:error:]
to begin download or to synchronize the local copy with the cloud copy.NSMetadataQuery
or by polling URL resource values with [NSURL resourceValuesForKeys:]
.NSFileCoordinator
to coordinate your file access with the ubiquity daemon.NSFilePresenter
to get notifications of changes to files.This is all covered in sessions from WWDC 2012 (and maybe 2011, I don't recall), and the classes and methods you'll need are all in the iOS documentation.